-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "ui/LocalePanel.h" | ||
#include "ui/UIListLabel.h" | ||
#include "ui/UILabel.h" | ||
|
||
void LocalePanel::Text(int i, int j, UIListLabel* listlabel, UILabel* label) const { | ||
Entry* entry = (Entry*)&mEntries[j]; | ||
if(listlabel->Matches("heading")){ | ||
label->SetEditText(entry->mHeading.c_str()); | ||
} | ||
else if(listlabel->Matches("label")){ | ||
label->SetEditText(entry->mLabel.c_str()); | ||
} | ||
else if(listlabel->Matches("token")){ | ||
label->SetEditText(entry->mToken.Str()); | ||
} | ||
else if(listlabel->Matches("string")){ | ||
label->SetEditText(entry->mString.c_str()); | ||
} | ||
} | ||
|
||
int LocalePanel::NumData() const { return mEntries.size(); } | ||
|
||
bool LocalePanel::IsActive(int i) const { return !mEntries[i].mLabel.empty(); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef UI_LOCALEPANEL_H | ||
#define UI_LOCALEPANEL_H | ||
#include "ui/UIPanel.h" | ||
#include "ui/UIListProvider.h" | ||
|
||
class LocalePanel : public UIPanel, public UIListProvider { | ||
public: | ||
class Entry { // size 0x28 | ||
public: | ||
Entry(){} | ||
String mHeading; // 0x0 - heading? | ||
String mLabel; // 0xc - label? | ||
Symbol mToken; // 0x18 - token? | ||
String mString; // 0x20 - string? | ||
}; | ||
|
||
LocalePanel(){} | ||
OBJ_CLASSNAME(LocalePanel); | ||
OBJ_SET_TYPE(LocalePanel); | ||
virtual DataNode Handle(DataArray*, bool); | ||
virtual ~LocalePanel(){} | ||
virtual void Enter(); | ||
virtual void Text(int, int, UIListLabel*, UILabel*) const; | ||
virtual int NumData() const; | ||
virtual bool IsActive(int) const; | ||
virtual float GapSize(int, int, int, int) const; | ||
|
||
std::vector<Entry> mEntries; | ||
}; | ||
|
||
#endif |