From: Andy D. <kha...@us...> - 2003-07-30 19:39:49
|
Update of /cvsroot/planeshift/planeshift/src/client/paws In directory sc8-pr-cvs1:/tmp/cvs-serv14939/src/client/paws Modified Files: shortcutwindow.cpp Log Message: With the wonders of XML, the shortcut window can be fully resizable in case you like em big or you like em small Index: shortcutwindow.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/shortcutwindow.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** shortcutwindow.cpp 30 Jul 2003 17:14:26 -0000 1.4 --- shortcutwindow.cpp 30 Jul 2003 19:39:46 -0000 1.5 *************** *** 39,48 **** LoadCommands(); ! // Create 10 buttons ! for (int i = 0;i < 10;i++) ! { ! buttons[i] = (pawsButton*)windowManager->CreateWidget("pawsButton"); ! AddChild(buttons[i]); ! } csRef<iPSEngine> psengine = CS_QUERY_REGISTRY( windowManager->GetObjectRegistry(), iPSEngine ); --- 39,43 ---- LoadCommands(); ! csRef<iPSEngine> psengine = CS_QUERY_REGISTRY( windowManager->GetObjectRegistry(), iPSEngine ); *************** *** 52,56 **** textBox = NULL; labelBox = NULL; - } --- 47,50 ---- *************** *** 62,84 **** bool pawsShortcutWindow::PostSetup() { ! int width = screenFrame.Width() / 2; ! int height = (screenFrame.Height() - 10) / 5; for (int i = 0;i < 10;i++) { ! if (i < 5) ! buttons[i]->MoveTo(screenFrame.xmin, screenFrame.ymin + height*i + 10); ! else ! buttons[i]->MoveTo(screenFrame.xmin + width, screenFrame.ymin + height*(i - 5) + 10); ! buttons[i]->SetSize(width, height); if (!name[i].IsEmpty()) buttons[i]->SetText(name[i]); else buttons[i]->SetText("None"); - buttons[i]->SetID(1000 + i); - buttons[i]->UseBorder(); - buttons[i]->Show(); } - Show(); return true; } --- 56,76 ---- bool pawsShortcutWindow::PostSetup() { ! subWidget = (pawsWidget*)windowManager->FindWidget("ShortcutEdit"); ! if (subWidget) ! { ! labelBox = (pawsEditTextBox*)subWidget->FindWidget("LabelBox"); ! textBox = (pawsEditTextBox*)subWidget->FindWidget("CommandBox"); ! } for (int i = 0;i < 10;i++) { ! buttons[i] = (pawsButton*)FindWidget(1000+i); ! if (!(buttons[i])) ! continue; if (!name[i].IsEmpty()) buttons[i]->SetText(name[i]); else buttons[i]->SetText("None"); } return true; } |