Use the new draw parameter instead
svn-id: r16167
This commit is contained in:
parent
1184e19657
commit
318631a094
1 changed files with 28 additions and 41 deletions
|
@ -77,12 +77,12 @@ void GetMemory(UInt32* storageMemoryP, UInt32* dynamicMemoryP, UInt32 *storageFr
|
||||||
if (storageFreeP) *storageFreeP = storageFree;
|
if (storageFreeP) *storageFreeP = storageFree;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void VersionTabPreInit(FormType *frmP) {
|
static void VersionTabDraw() {
|
||||||
FrmNewLabel(&frmP, 4210, gScummVMVersion, 49, 12, stdFont);
|
WinDrawChars(gScummVMVersion, StrLen(gScummVMVersion), 47, 12 + 30);
|
||||||
FrmNewLabel(&frmP, 4211, gScummVMBuildDate, 49, 24, stdFont);
|
WinDrawChars(gScummVMBuildDate, StrLen(gScummVMBuildDate), 47, 24 + 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SystemTabPreInit(FormType *frmP) {
|
static void SystemTabDraw() {
|
||||||
Coord x;
|
Coord x;
|
||||||
UInt32 dm, sm, df, sf, stack;
|
UInt32 dm, sm, df, sf, stack;
|
||||||
Char num[10];
|
Char num[10];
|
||||||
|
@ -94,28 +94,28 @@ static void SystemTabPreInit(FormType *frmP) {
|
||||||
FntSetFont(stdFont);
|
FntSetFont(stdFont);
|
||||||
|
|
||||||
StrIToA(num, dm);
|
StrIToA(num, dm);
|
||||||
x = 149 - FntCharsWidth(num, StrLen(num)) + 5;
|
x = 147 - FntCharsWidth(num, StrLen(num)) + 5;
|
||||||
FrmNewLabel(&frmP, 4308, num, x, 12, stdFont);
|
WinDrawChars(num, StrLen(num), x, 12 + 30);
|
||||||
|
|
||||||
StrIToA(num, sm);
|
StrIToA(num, sm);
|
||||||
x = 149 - FntCharsWidth(num, StrLen(num)) + 5;
|
x = 147 - FntCharsWidth(num, StrLen(num)) + 5;
|
||||||
FrmNewLabel(&frmP, 4309, num, x, 24, stdFont);
|
WinDrawChars(num, StrLen(num), x, 24 + 30);
|
||||||
|
|
||||||
StrIToA(num, stack);
|
StrIToA(num, stack);
|
||||||
x = 149 - FntCharsWidth(num, StrLen(num)) + 5;
|
x = 147 - FntCharsWidth(num, StrLen(num)) + 5;
|
||||||
FrmNewLabel(&frmP, 4310, num, x, 36, stdFont);
|
WinDrawChars(num, StrLen(num), x, 36 + 30);
|
||||||
|
|
||||||
StrIToA(num, df);
|
StrIToA(num, df);
|
||||||
x = 109 - FntCharsWidth(num, StrLen(num)) + 5;
|
x = 107 - FntCharsWidth(num, StrLen(num)) + 5;
|
||||||
FrmNewLabel(&frmP, 4311, num, x, 12, stdFont);
|
WinDrawChars(num, StrLen(num), x, 12 + 30);
|
||||||
|
|
||||||
StrIToA(num, sf);
|
StrIToA(num, sf);
|
||||||
x = 109 - FntCharsWidth(num, StrLen(num)) + 5;
|
x = 107 - FntCharsWidth(num, StrLen(num)) + 5;
|
||||||
FrmNewLabel(&frmP, 4312, num, x, 24, stdFont);
|
WinDrawChars(num, StrLen(num), x, 24 + 30);
|
||||||
|
|
||||||
StrCopy(num,"-");
|
StrCopy(num,"-");
|
||||||
x = 109 - FntCharsWidth(num, StrLen(num)) + 5;
|
x = 107 - FntCharsWidth(num, StrLen(num)) + 5;
|
||||||
FrmNewLabel(&frmP, 4313, num, x, 36, stdFont);
|
WinDrawChars(num, StrLen(num), x, 36 + 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InfoFormSave() {
|
static void InfoFormSave() {
|
||||||
|
@ -123,13 +123,7 @@ static void InfoFormSave() {
|
||||||
FrmReturnToMain();
|
FrmReturnToMain();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AboutTabInit(Boolean draw) {
|
static void AboutTabDraw() {
|
||||||
if (!draw) {
|
|
||||||
RectangleType r = {2, 40, 154, 45};
|
|
||||||
WinSetBackColor(UIColorGetTableEntryIndex(UIFormFill));
|
|
||||||
WinEraseRectangle(&r, 0);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
MemHandle hTemp;
|
MemHandle hTemp;
|
||||||
BitmapPtr bmpTemp;
|
BitmapPtr bmpTemp;
|
||||||
|
|
||||||
|
@ -140,7 +134,6 @@ static void AboutTabInit(Boolean draw) {
|
||||||
MemPtrUnlock(bmpTemp);
|
MemPtrUnlock(bmpTemp);
|
||||||
DmReleaseResource(hTemp);
|
DmReleaseResource(hTemp);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InfoFormInit() {
|
static void InfoFormInit() {
|
||||||
|
@ -148,16 +141,14 @@ static void InfoFormInit() {
|
||||||
FormType *frmP = FrmGetActiveForm();
|
FormType *frmP = FrmGetActiveForm();
|
||||||
|
|
||||||
tabP = TabNewTabs(3);
|
tabP = TabNewTabs(3);
|
||||||
TabAddContent(&frmP, tabP, "About", TabInfoAboutForm);
|
TabAddContent(&frmP, tabP, "About", TabInfoAboutForm, AboutTabDraw);
|
||||||
TabAddContent(&frmP, tabP, "Version", TabInfoVersionForm, VersionTabPreInit);
|
TabAddContent(&frmP, tabP, "Version", TabInfoVersionForm, VersionTabDraw);
|
||||||
TabAddContent(&frmP, tabP, "Memory", TabInfoSystemForm, SystemTabPreInit);
|
TabAddContent(&frmP, tabP, "Memory", TabInfoSystemForm, SystemTabDraw);
|
||||||
|
|
||||||
lastTab = 0;
|
lastTab = 0;
|
||||||
FrmDrawForm(frmP);
|
FrmDrawForm(frmP);
|
||||||
TabSetActive(frmP, tabP, lastTab);
|
TabSetActive(frmP, tabP, lastTab);
|
||||||
|
|
||||||
AboutTabInit(true);
|
|
||||||
|
|
||||||
myTabP = tabP;
|
myTabP = tabP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,12 +168,8 @@ Boolean InfoFormHandleEvent(EventPtr eventP) {
|
||||||
case (InfoForm + 1) :
|
case (InfoForm + 1) :
|
||||||
case (InfoForm + 2) :
|
case (InfoForm + 2) :
|
||||||
case (InfoForm + 3) :
|
case (InfoForm + 3) :
|
||||||
if (lastTab == 0) AboutTabInit(false);
|
|
||||||
|
|
||||||
lastTab = (eventP->data.ctlSelect.controlID - InfoForm - 1);
|
lastTab = (eventP->data.ctlSelect.controlID - InfoForm - 1);
|
||||||
TabSetActive(frmP, myTabP, lastTab);
|
TabSetActive(frmP, myTabP, lastTab);
|
||||||
|
|
||||||
if (lastTab == 0) AboutTabInit(true);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case InfoOKButton:
|
case InfoOKButton:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue