bool Mint::ProcessEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { if(!m_pMainFrame) return false; MEvent e; int nResult = e.TranslateEvent(hwnd, message, wparam, lparam); if(nResult&EVENT_MINT_TRANSLATED){ // Drag & Drop if(m_pDragSourceObject!=NULL){ #define DRAm_VISIBLE_LENGTH 2 // µå·¡±× ¿ÀºêÁ§Æ®¸¦ º¸¿©Áֱ⠽ÃÀÛÇÏ´Â °£°Ý if(e.nMessage==MWM_MOUSEMOVE){ MPOINT p = e.Pos; //MPOINT p = MEvent::GetMousePos(); int px = m_GrabPoint.x - p.x; if ( px < 0) px *= -1; int py = m_GrabPoint.y - p.y; if ( py < 0) py *= -1; if( m_bVisibleDragObject==false && ((px > DRAm_VISIBLE_LENGTH) || (py > DRAm_VISIBLE_LENGTH))) m_bVisibleDragObject = true; MWidget* pFind = FindWidget(p); if(pFind!=NULL && pFind->IsDropable(m_pDragSourceObject)==true) m_pDropableObject = pFind; else m_pDropableObject = NULL; } if(e.nMessage==MWM_LBUTTONUP){ MPOINT p = e.Pos; MWidget* pFind = FindWidgetDropAble(p); // MWidget* pFind = FindWidget(p); if(pFind!=NULL && pFind->IsDropable(m_pDragSourceObject)==true) pFind->Drop(m_pDragSourceObject, m_pDragObjectBitmap, m_szDragObjectString, m_szDragObjectItemString); // ÇØ´ç À§Á¬¿¡ µå·Ó m_pDragSourceObject = NULL; m_pMainFrame->ReleaseCapture(); return true; } } // Àü¿ª À̺¥Æ® ó¸® if (m_fnGlobalEventCallBack) { if (m_fnGlobalEventCallBack(&e) == true) return true; } // ÀÏ¹Ý À̺¥Æ® ó¸® if(m_pMainFrame->Event(&e)==true) return true; // ¾øÀ¸¸é Accelerator ó¸® if(m_pMainFrame->EventAccelerator(&e)==true) return true; // Default Key(Enter, ESC) ó¸® if(m_pMainFrame->EventDefaultKey(&e)==true) return true; } if(nResult&EVENT_PROCESSED) return true; // ¹«Á¶°Ç ó¸®µÊ return false; }
// ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // void CWrtHarvester::ProcessNetworkModeL( TUid& aUid, TWidgetOperations aOperation ) { // first queue the online/offline event and then the resume event QueueOperationL( aOperation, aUid ); // check if there is a resume event to queue TInt idx = FindWidget(aUid, EResumeState); if ( idx != -1 ) { QueueResumeL( aUid ); } idx = (idx == -1) ? FindWidget(aUid): idx; if(idx != -1 ) { // remove it from the array, no longer needed delete iWidgetStateArray[idx]; iWidgetStateArray.Remove(idx); } }
bool pawsConfigEntityInteraction::PostSetup() { for (size_t i=0; i < entTypes->types.GetSize(); i++) { psEntityType * type = entTypes->types[i]; pawsTextBox * txt = dynamic_cast <pawsTextBox*> (FindWidget(type->id+"_label")); if (txt == NULL) return false; txt->SetText(type->label+":"); pawsComboBox * combo = dynamic_cast <pawsComboBox*> (FindWidget(type->id)); if (combo == NULL) return false; for (size_t j=0; j < type->labels.GetSize(); j++) combo->NewOption(type->labels[j]); } return true; }
void pawsTabWindow::SetTab(const csString & name) { pawsWidget * tab = FindWidget(name); if(!tab) return; if(!dynamic_cast<pawsButton*>(tab)) SetTab(tab->GetID() - 100); else SetTab(tab->GetID()); }
bool pawsConfigPopup::PostSetup() { magicWindow = (pawsActiveMagicWindow*)PawsManager::GetSingleton().FindWidget("ActiveMagicWindow"); if(!magicWindow) { Error1("Couldn't find ActiveMagicWindow!"); return false; } //check if we can get the pawsnpcdialog else fail. npcDialog = (pawsNpcDialogWindow*)PawsManager::GetSingleton().FindWidget("NPCDialogWindow"); if(!npcDialog) { Error1("Couldn't find NPCDialogWindow!"); return false; } //check if we can get the psmainwidget else fail. mainWidget = psengine->GetMainWidget(); if(!mainWidget) { Error1("Couldn't find psmainwidget!"); return false; } showActiveMagicConfig = (pawsCheckBox*)FindWidget("ShowActiveMagicWindowConfig"); if (!showActiveMagicConfig) return false; useNpcDialogBubbles = (pawsCheckBox*)FindWidget("UseNpcDialogBubbles"); if (!useNpcDialogBubbles) return false; //we set all checkboxes as true by default for(size_t i = 0; i < children.GetSize(); i++) { pawsCheckBox *check = dynamic_cast<pawsCheckBox*>(children.Get(i)); if(check) { check->SetState(true); } } return true; }
PG_Widget* PG_Navigator::FindDown(PG_Widget* widget) { if(widget == NULL) { widget = my_currentWidget; } PG_Point p; p.x = widget->x + widget->w / 2; p.y = widget->y + widget->h / 2; return FindWidget(widget, p, true, false, 0, +1); }
bool pawsLifeEventWindow::PostSetup() { choiceSelection = (pawsSelectorBox*)FindWidget("Life Event"); if ( choiceSelection == NULL ) return false; cpBox = (pawsTextBox*)FindWidget("CP"); if ( !cpBox ) return false; choiceDesc = (pawsMultiLineTextBox*)FindWidget("EventDesc"); if ( !choiceDesc ) return false; selectedDesc = (pawsMultiLineTextBox*)FindWidget("SelEventDesc"); if ( !selectedDesc ) return false; return true; }
bool pawsSummaryWindow::PostSetup() { skillsList = (pawsListBox*)FindWidget("skill_list"); if ( skillsList == NULL ) return false; statsList = (pawsListBox*)FindWidget("stat_list"); if ( statsList == NULL ) return false; serverStatus = (pawsTextBox*)FindWidget("server_status"); if ( serverStatus == NULL ) return false; view = (pawsObjectView*)FindWidget("ModelView"); if ( view == NULL ) return false; while(!view->ContinueLoad()) { csSleep(100); } return true; }
bool pawsQuestRewardWindow::PostSetup() { if ( !psCmdBase::Setup( psengine->GetMsgHandler(), psengine->GetCmdHandler()) ) return false; msgqueue->Subscribe(this, MSGTYPE_QUESTREWARD); rewardList = (pawsListBox*)FindWidget("QuestRewardList"); return true; }
void PG_ListBox::SelectFirstItem() { PG_ListBoxBaseItem* item = (PG_ListBoxBaseItem*)FindWidget(0); if(item == NULL) { return; } item->Select(); }
bool pawsControlWindow::PostSetup() { SetAlwaysOnTop(true); AddWindow( "InventoryWindow" , "InventoryButton" ); AddWindow( "ConfigWindow" , "OptionsButton" ); AddWindow( "SpellBookWindow" , "SpellBookButton" ); AddWindow( "AttackBookWindow" , "AttackButton" ); AddWindow( "InfoWindow" , "InfoButton" ); AddWindow( "HelpWindow" , "HelpButton" ); AddWindow( "ShortcutMenu" , "ShortcutButton" ); AddWindow( "BuddyWindow" , "BuddyButton" ); AddWindow( "GroupWindow" , "GroupButton" ); AddWindow( "PetitionWindow" , "PetitionButton" ); AddWindow( "ChatWindow" , "ChatButton" ); AddWindow( "SkillWindow" , "SkillsButton" ); AddWindow( "QuestNotebook" , "QuestButton" ); AddWindow( "GuildWindow" , "GuildButton" ); AddWindow( "ActiveMagicWindow" , "ActiveMagicButton" ); keyboard = csQueryRegistry<iKeyboardDriver> (PawsManager::GetSingleton().GetObjectRegistry()); //The quit button is a bit special //We need to manualy register it QuitIcon = new Icon; QuitIcon->window = NULL; QuitIcon->theirButton = (pawsButton*)FindWidget("QuitButton"); QuitIcon->orgRes = QuitIcon->theirButton->GetBackground(); QuitIcon->IsActive = false; QuitIcon->IsOver = false; buttons.Push(QuitIcon); csRef<iConfigManager> file = psengine->GetConfig(); int loadStyle = file->GetInt("PlaneShift.GUI.ControlWindow.CurrentStyle", 1); for (int i=0; i < loadStyle; i++) NextStyle(); // Switch to saved style buttonUp = FindWidget("ShowButtonUp"); buttonDown = FindWidget("ShowButtonDown"); return true; }
void pawsCharacterPickerWindow::SelectCharacter(int character, pawsWidget* widget) { if(!gotStrings) return; pawsWidget* wdg; // change 4 to 1 get char chetty for (int i = 0;i < 1; i++) { csString name; name = "ImgCharacter"; name += i; wdg = FindWidget(name); if (!wdg) return; if (character == i) wdg->SetBackground("radioon2"); else wdg->SetBackground("radiooff2"); } pawsButton* loginWidget = (pawsButton*)FindWidget("login"); selectedCharacter = widget->GetID(); loginWidget->SetText( PawsManager::GetSingleton().Translate("Join") ); // If the button selected has an empty character then button will // be for creating a new character if ( widget->GetID() >= charactersFound ) { SetupCharacterCreationScreens(); } else { // Show the model for the selected character. loaded = false; charApp->SetMesh(0); CheckLoadStatus(); } }
void pawsCharBirth::OnListAction( pawsListBox* widget, int status ) { if (status==LISTBOX_HIGHLIGHTED) { // Figure out which list box was checked and act accordingly pawsListBoxRow* row = widget->GetSelectedRow(); if (widget->GetID() == MONTH_COMBOBOX) { pawsWidget* imgBox = FindWidget("zodiac_img"); pawsTextBox* textBox = (pawsTextBox*)FindWidget("zodiac"); pawsMultiLineTextBox* descBox = (pawsMultiLineTextBox*)FindWidget("zodiac_description"); if (!imgBox || !textBox || !descBox) return; Zodiac* zodiac = GetZodiac(widget->GetSelectedRowNum()+1); if (!zodiac) { Error2("No zodiac found for month number %d!",widget->GetSelectedRowNum()+1); return; } imgBox->SetBackground(zodiac->img); imgBox->SetBackgroundAlpha(0); textBox->SetText(zodiac->name); descBox->SetText(zodiac->desc); if ( lastZodiacChoice != -1 ) { createManager->RemoveChoice( lastZodiacChoice ); } createManager->AddChoice( row->GetID() ); lastZodiacChoice = row->GetID(); UpdateCP(); } } UpdateCP(); }
bool pawsConfigEntityInteraction::LoadConfig() { for (size_t i=0; i < entTypes->types.GetSize(); i++) { psEntityType * type = entTypes->types[i]; pawsComboBox * combo = dynamic_cast <pawsComboBox*> (FindWidget(type->id)); if (combo) combo->Select(type->usedCommand); } dirty = false; return true; }
bool pawsCharacterPickerWindow::OnButtonReleased(int /*mouseButton*/, int /*keyModifer*/, pawsWidget* widget) { if(!widget) return false; switch ( widget->GetID() ) { case YES_DELETE_CHARACTER: { PawsManager::GetSingleton().SetModalWidget(NULL); widget->GetParent()->Hide(); pawsStringPromptWindow::Create("Please enter your account password to confirm:", csString(""),false, 220, 20, this, "DeletionConfirm", 0, true); pawsEditTextBox* passbox = dynamic_cast<pawsEditTextBox*> (PawsManager::GetSingleton().FindWidget("stringPromptEntry")); if (passbox) { passbox->SetPassword(true); } return true; } case NO_DELETE_CHARACTER: { return true; } case CONFIRM_YES: { //Delete the selected character csString name; name.Format("SelectCharacter%i", selectedCharacter); // Get Full name. psString charFullName( ((pawsButton*)FindWidget(name))->GetText() ); psString charFirstName; charFullName.GetWord( 0, charFirstName ); psCharDeleteMessage msg(charFirstName, 0); msg.SendMessage(); return true; } case CONFIRM_NO: { PawsManager::GetSingleton().SetModalWidget(NULL); widget->GetParent()->Hide(); return true; } } return false; }
bool pawsTabWindow::PostSetup() { lastButton = (pawsButton*)FindWidget(1000); if (!lastButton) lastButton = (pawsButton*)FindWidget(1200); lastButton->SetState(true); activeTab = FindWidget(1100); if (!activeTab) activeTab = FindWidget(1200); // Hide all the panels so we can show the active one after for ( size_t z = 0; z < children.GetSize(); z++ ) { if ( strcmp(children[z]->GetType(), "pawsButton") != 0) children[z]->Hide(); } activeTab->Show(); PawsManager::GetSingleton().SetCurrentFocusedWidget(activeTab); Resize(); return true; }
bool pawsCharacterPickerWindow::PostSetup() { // Subscribe our message types that we are interested in. psengine->GetMsgHandler()->Subscribe(this,MSGTYPE_AUTHAPPROVED); psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_CHAR_DELETE); view = (pawsObjectView*)FindWidget("PaperDollView"); view->Rotate(10,0.01f); view->EnableMouseControl(true); return true; }
bool pawsNpcDialogWindow::PostSetup() { psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_DIALOG_MENU); psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_CHAT); psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_REMOVE_OBJECT); responseList = dynamic_cast<pawsListBox*>(FindWidget("ResponseList")); speechBubble = FindWidget("SpeechBubble"); textBox = dynamic_cast<pawsEditTextBox*>(FindWidget("InputText")); closeBubble = dynamic_cast<pawsButton*>(FindWidget("CloseBubble")); if(!responseList || !FindWidget("Lists") || !speechBubble || !FindWidget("Bubbles") || !closeBubble) { return false; } //loads the options regarding this window if(!LoadSetting()) { //setup the window with defaults. SetupWindowWidgets(); CleanBubbles(); } return true; }
void pawsNpcDialogWindow::NpcSays(csString &inText,GEMClientActor* actor) { //this is used only when using the chat bubbles interface if(!useBubbles) { return; } clickedOnResponseBubble = false; //display npc response if(IsVisible() && actor && psengine->GetCharManager()->GetTarget() == actor) { dynamic_cast<pawsMultiLineTextBox*>(speechBubble->FindWidget("BubbleText"))->SetText(inText.GetData()); speechBubble->Show(); FindWidget("Bubble1")->Hide(); FindWidget("Bubble2")->Hide(); FindWidget("Bubble3")->Hide(); FindWidget("LeftArrow")->Hide(); FindWidget("RightArrow")->Hide(); FindWidget("FreeBubble")->Hide(); ticks = csGetTicks(); timeDelay = (csTicks)(2000 + 50*strlen(inText.GetData()) + 2000); // add 2 seconds for network delay timeDelay = timeDelay>14000?14000:timeDelay; // clamp to 14000 max Show(); //show the npc dialog } }
bool pawsConfigEntityInteraction::SaveConfig() { for (size_t i=0; i < entTypes->types.GetSize(); i++) { psEntityType * type = entTypes->types[i]; pawsComboBox * combo = dynamic_cast <pawsComboBox*> (FindWidget(type->id)); if (combo) type->usedCommand = combo->GetSelectedRowNum(); } entTypes->SaveConfigToFile(); dirty = false; return true; }
void pawsConfigEntityInteraction::SetDefault() { for (size_t i=0; i < entTypes->types.GetSize(); i++) { psEntityType * type = entTypes->types[i]; pawsComboBox * combo = dynamic_cast <pawsComboBox*> (FindWidget(type->id)); if (combo) combo->Select(type->dflt); type->usedCommand = type->dflt; } entTypes->SaveConfigToFile(); dirty = true; }
bool pawsGroupWindow::PostSetup() { psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_GUIGROUP); memberList = (pawsListBox*)FindWidget("List"); if ( !memberList ) return false; chatWindow = (pawsChatWindow*)PawsManager::GetSingleton().FindWidget("ChatWindow"); if (!chatWindow) return false; return true; }
void PG_ListBox::SelectNextItem() { if (m_poCurrentItem) { int index = FindIndex(m_poCurrentItem); index = omMAX(0, index+1); PG_ListBoxBaseItem *item = (PG_ListBoxBaseItem *)FindWidget(index); if (item) { item->Select(); } } }
void pawsCharacterPickerWindow::ReceivedStrings() { gotStrings = true; pawsTextBox* label = (pawsTextBox*)FindWidget("wait_label"); if(label) label->Hide(); if(charactersFound > 0 && charactersFound == psengine->GetNumChars()) { SelectCharacter(0); } }
bool pawsPetitionGMWindow::PostSetup() { // Setup this widget to receive messages and commands if ( !psCmdBase::Setup( psengine->GetMsgHandler(), psengine->GetCmdHandler()) ) return false; // Subscribe to certain types of messages (those we want to handle) msgqueue->Subscribe(this, MSGTYPE_PETITION); // Grab the pointer to the petition listbox: petitionList = (pawsListBox*)FindWidget("PetitionList"); petText = (pawsMessageTextBox*)FindWidget("PetitionText"); hasPetInterest = false; petCount = -1; //default value: we didn't receive petitions yet //TODO: this should be removed when autocompletion autocompletes /show // If player is GM, give him the /petition_manage command if ( psengine->GetCelClient()->GetMainPlayer()->GetType() > 20 ) { cmdsource->Subscribe("/managepetitions", this); hasPetInterest = true; //gm are going to want to get informations about the petitions QueryServer(); //Query the server for messages } petitionList->SetSortingFunc(0, textBoxSortFunc); petitionList->SetSortingFunc(1, textBoxSortFunc); petitionList->SetSortingFunc(2, textBoxSortFunc); petitionList->SetSortingFunc(3, textBoxSortFunc); petitionList->SetSortingFunc(4, textBoxSortFunc); petitionList->SetSortingFunc(5, textBoxSortFunc); petitionList->SetSortingFunc(6, textBoxSortFunc); return true; }
void pawsConfigSound::OnListAction(pawsListBox* /*selected*/, int /*status*/) { pawsComboBox* soundlocation = (pawsComboBox*)FindWidget("soundLocation"); csString _selected = soundlocation->GetSelectedRowString(); if (_selected.Compare("Camera")) { psengine->GetSoundManager()->SetListenerOnCameraToggle(true); } else { psengine->GetSoundManager()->SetListenerOnCameraToggle(false); } SaveConfig(); }
bool pawsPathWindow::PostSetup() { int i = 1; csPDelArray<PathDefinition>::Iterator iter = createManager->GetPathIterator(); while(iter.HasNext()) { PathDefinition* path = iter.Next(); pawsButton* widget = (pawsButton*) FindWidget(PATH_0 + i); widget->SetText(path->name); i++; } chosenPath = NO_CHOSEN_PATH; LabelHeaderVisibility(false); return true; }
void pawsPathWindow::LabelHeaderVisibility(bool visible) { { pawsWidget * label = FindWidget("label_parents_header"); if (label) { if(visible) label->Show(); else label->Hide(); } } { pawsWidget * label = FindWidget("label_life_header"); if (label) { if(visible) label->Show(); else label->Hide(); } } { pawsWidget * label = FindWidget("label_stat_header"); if (label) { if(visible) label->Show(); else label->Hide(); } } { pawsWidget * label = FindWidget("values_stat_header"); if (label) { if(visible) label->Show(); else label->Hide(); } } { pawsWidget * label = FindWidget("label_skill_header"); if (label) { if(visible) label->Show(); else label->Hide(); } } { pawsWidget * label = FindWidget("values_skill_header"); if (label) { if(visible) label->Show(); else label->Hide(); } } }
void PG_ListBox::SelectPrevItem() { if (m_poCurrentItem) { int index = FindIndex(m_poCurrentItem); if (index > 0) { PG_ListBoxBaseItem *item = (PG_ListBoxBaseItem *)FindWidget(index - 1); if (item) { item->Select(); } } } }
bool pawsBuddyWindow::PostSetup() { psengine->GetMsgHandler()->Subscribe( this, MSGTYPE_BUDDY_LIST ); psengine->GetMsgHandler()->Subscribe( this, MSGTYPE_BUDDY_STATUS ); buddyList = (pawsListBox*)FindWidget("BuddyList"); chatWindow = (pawsChatWindow*)PawsManager::GetSingleton().FindWidget("ChatWindow"); if (!chatWindow) { Error1("BuddyWindow failed because Chat window was not found."); return false; } return true; }