aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Apers2003-11-28 09:59:52 +0000
committerChris Apers2003-11-28 09:59:52 +0000
commit461e8d19bf5ad917df239600c78a1d5bc82069b7 (patch)
tree84a193a98342711a74987adfdc6a63e2228fc503
parentadf03c85d60619b1b780bfd4688851e2b30fbf48 (diff)
downloadscummvm-rg350-461e8d19bf5ad917df239600c78a1d5bc82069b7.tar.gz
scummvm-rg350-461e8d19bf5ad917df239600c78a1d5bc82069b7.tar.bz2
scummvm-rg350-461e8d19bf5ad917df239600c78a1d5bc82069b7.zip
Fixed list position + set focus on new entry
svn-id: r11400
-rw-r--r--backends/PalmOS/Src/forms/formEditGame.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/backends/PalmOS/Src/forms/formEditGame.cpp b/backends/PalmOS/Src/forms/formEditGame.cpp
index 3bc97c3c97..da88dc95dc 100644
--- a/backends/PalmOS/Src/forms/formEditGame.cpp
+++ b/backends/PalmOS/Src/forms/formEditGame.cpp
@@ -134,7 +134,7 @@ static void EditGameFormSave(UInt16 index) {
// update list position
{
RectangleType rArea;
- UInt16 posIndex, maxIndex, maxView;
+ UInt16 posIndex, maxView;
// get the sorted index
index = GamGetSelected();
@@ -142,14 +142,10 @@ static void EditGameFormSave(UInt16 index) {
SknGetListBounds(&rArea, NULL);
maxView = rArea.extent.y / sknInfoListItemSize;
posIndex = gPrefs->listPosition;
- maxIndex = DmNumRecords(gameDB);
- if (index == 0 && posIndex > 0) {
- gPrefs->listPosition = 0;
- } else if ((maxView + posIndex) <= index) {
- posIndex = index - (maxView - posIndex) + 1;
- gPrefs->listPosition = posIndex;
- }
+ // if out of the current list position
+ if (!(index >= posIndex && index < (posIndex + maxView)))
+ gPrefs->listPosition = index; // this value is corrected in SknUpdateList if needed
}
FrmReturnToMain();
@@ -193,7 +189,7 @@ static void EditGameFormInit(UInt16 index) {
roomP = (Char *)MemHandleLock(roomH);
talkP = (Char *)MemHandleLock(talkH);
-// index = GamGetSelected();
+ frmP = FrmGetActiveForm();
if (index != dmMaxRecordIndex) {
recordH = DmQueryRecord(gameDB, index);
@@ -238,6 +234,8 @@ static void EditGameFormInit(UInt16 index) {
LstSetSelection(list2P, 0);
LstSetSelection(list3P, 0);
CtlSetUsable((ControlType *)GetObjectPtr(EditGameDeleteButton),false);
+
+ FrmSetFocus(frmP, FrmGetObjectIndex(frmP, EditGameEntryNameField));
}
MemHandleUnlock(nameH);
@@ -258,7 +256,6 @@ static void EditGameFormInit(UInt16 index) {
CtlSetLabel((ControlType *)GetObjectPtr(EditGameLanguagePopTrigger), LstGetSelectionText(list2P, LstGetSelection(list2P)));
CtlSetLabel((ControlType *)GetObjectPtr(EditGamePlatformPopTrigger), LstGetSelectionText(list3P, LstGetSelection(list3P)));
- frmP = FrmGetActiveForm();
FrmDrawForm(frmP);
}