LONG CTEKWindow::OnChangeMenu(UINT wParam, LONG lParam) { HMENU SysMenu; BOOL Show, B1, B2; Show = (ts.PopupMenu==0) && (ts.HideTitle==0); if (Show != (MainMenu!=NULL)) { if (! Show) { if (WinMenu!=NULL) { DestroyMenu(WinMenu); } WinMenu = NULL; DestroyMenu(MainMenu); MainMenu = NULL; } else { InitMenu(&MainMenu); } tk.AdjustSize = TRUE; ::SetMenu(tk.HWin, MainMenu); ::DrawMenuBar(HTEKWin); } B1 = ((ts.MenuFlag & MF_SHOWWINMENU)!=0); B2 = (WinMenu!=NULL); if ((MainMenu!=NULL) && (B1 != B2)) { if (WinMenu==NULL) { WinMenu = CreatePopupMenu(); get_lang_msg("TEKMENU_WINDOW", ts.UIMsg, sizeof(ts.UIMsg), "&Window", ts.UILanguageFile); ::InsertMenu(MainMenu,4, MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION, (int)WinMenu, ts.UIMsg); } else { RemoveMenu(MainMenu,4,MF_BYPOSITION); DestroyMenu(WinMenu); WinMenu = NULL; } ::DrawMenuBar(HTEKWin); } ::GetSystemMenu(tk.HWin,TRUE); if ((! Show) && ((ts.MenuFlag & MF_NOSHOWMENU)==0)) { SysMenu = ::GetSystemMenu(tk.HWin,FALSE); AppendMenu(SysMenu, MF_SEPARATOR, 0, NULL); get_lang_msg("TEKMENU_SHOW_MENUBAR", ts.UIMsg, sizeof(ts.UIMsg), "Show menu &bar", ts.UILanguageFile); AppendMenu(SysMenu, MF_STRING, ID_SHOWMENUBAR, ts.UIMsg); } return 0; }
HRESULT CSEShellView::UIActivate(UINT uState) { TRACE_FUNCTION(); if ( SVUIA_DEACTIVATE == uState ) { UninitMenu(); } else { InitMenu(); } TRACE_RETURN S_OK; }
void CTEKWindow::OnLButtonDown(UINT nFlags, CPoint point) { POINT p; HMENU PopupMenu, PopupBase; p.x = point.x; p.y = point.y; // popup menu if (ControlKey() && (MainMenu==NULL)) { InitMenu(&PopupMenu); InitMenuPopup(EditMenu); if (WinMenu!=NULL) { InitMenuPopup(WinMenu); } PopupBase = CreatePopupMenu(); get_lang_msg("MENU_CONTROL", ts.UIMsg, sizeof(ts.UIMsg), "&File", ts.UILanguageFile); AppendMenu(PopupBase, MF_STRING | MF_ENABLED | MF_POPUP, (UINT)GetSubMenu(PopupMenu,0), ts.UIMsg); get_lang_msg("TEKMENU_EDIT", ts.UIMsg, sizeof(ts.UIMsg), "&Edit", ts.UILanguageFile); AppendMenu(PopupBase, MF_STRING | MF_ENABLED | MF_POPUP, (UINT)EditMenu, ts.UIMsg); get_lang_msg("TEKMENU_SETUP", ts.UIMsg, sizeof(ts.UIMsg), "&Setup", ts.UILanguageFile); AppendMenu(PopupBase, MF_STRING | MF_ENABLED | MF_POPUP, (UINT)GetSubMenu(PopupMenu,2), ts.UIMsg); get_lang_msg("TEKMENU_VTWIN", ts.UIMsg, sizeof(ts.UIMsg), "VT-Wind&ow", ts.UILanguageFile); AppendMenu(PopupBase, MF_STRING | MF_ENABLED, ID_TEKVTWIN, ts.UIMsg); if (WinMenu!=NULL) { get_lang_msg("TEKMENU_WINDOW", ts.UIMsg, sizeof(ts.UIMsg), "&Window", ts.UILanguageFile); AppendMenu(PopupBase, MF_STRING | MF_ENABLED | MF_POPUP, (UINT)WinMenu, ts.UIMsg); } get_lang_msg("TEKMENU_HELP", ts.UIMsg, sizeof(ts.UIMsg), "&Help", ts.UILanguageFile); AppendMenu(PopupBase, MF_STRING | MF_ENABLED | MF_POPUP, (UINT)GetSubMenu(PopupMenu,4), ts.UIMsg); ::ClientToScreen(tk.HWin, &p); TrackPopupMenu(PopupBase,TPM_LEFTALIGN | TPM_LEFTBUTTON, p.x,p.y,0,tk.HWin,NULL); if (WinMenu!=NULL) { DestroyMenu(WinMenu); WinMenu = NULL; } DestroyMenu(PopupBase); DestroyMenu(PopupMenu); return; } TEKWMLButtonDown(&tk,&ts,&cv,p); }
void InitMenu(HMENU menu,CString KeyName) { if ( menu==NULL || ( !::IsMenu(menu))) return ; CString tempname(_T("")); tempname=KeyName; CString szText; int nCount,subCount, id; nCount =GetMenuItemCount(menu);// menu->GetMenuItemCount(); //获取该层菜单数 for(int i=0;i<nCount;i++) //遍历所有菜单项 { //查看子菜单 如果有子菜单,返回0,否则返回子菜单项数目,如果是子菜单项,返回资源中的菜单COMMAND ID KeyName=_T(""); KeyName=tempname; id= GetMenuItemID(menu,i); if (id!=-1) { szText.Format(_T("_%d"),id); KeyName+=szText; //ModifyMenu(menu, i, MF_BYPOSITION|MF_STRING, id, gLoadString(KeyName)); } else { szText.Format(_T("_%d"),i); KeyName+=szText; // ModifyMenu(menu, i, MF_BYPOSITION|MF_STRING, i, gLoadString(KeyName)); } CString name=gLoadString(KeyName); if (name.CompareNoCase(_T("Not found"))!=0) { ModifyMenu(menu, i, MF_BYPOSITION|MF_STRING, id, name); } //ModifyMenu(menu, i, MF_BYPOSITION|MF_STRING, i, gLoadString(KeyName)); if( id==-1 ) { subCount =GetMenuItemCount(GetSubMenu(menu,i)); if ( subCount>0 ) InitMenu(GetSubMenu(menu,i),KeyName); } } }
CEditorMainFrame::CEditorMainFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title, MAINFRAMEPOSITION, MAINFRAMESIZE) { SetIcon(wxICON(sample)); m_Manager.SetManagedWindow(this); m_pWEditAnimation = NULL; InitMenu(); InitCtrls(); SetStatusBar(new wxStatusBar(this)); SetStatusText(wxT("Welcome!")); SetMinSize(wxSize(400,300)); Centre(); }
static BOOL InitResource (void) { if (!InitFixStr ()) { fprintf (stderr, "MiniGUI: Can not initialize Fixed String heap failure!\n"); goto failure; } #ifdef _CURSOR_SUPPORT if (!InitCursor ()) { fprintf (stderr, "MiniGUI: Count not initialize mouse cursor!\n"); goto failure; } #endif if (!InitMenu ()) { fprintf (stderr, "MiniGUI: Init Menu module failure!\n"); goto failure; } if (!InitControlClass ()) { fprintf(stderr, "MiniGUI: Init Control Class failure!\n"); goto failure; } if (!InitAccel ()) { fprintf(stderr, "MiniGUI: Init Accelerator failure!\n"); goto failure; } if (!InitDesktop ()) { fprintf (stderr, "MiniGUI: Init Desktop error!\n"); goto failure; } if (!InitFreeQMSGList ()) { fprintf (stderr, "MiniGUI: Init free QMSG list error!\n"); goto failure; } if (!InitDskMsgQueue ()) { fprintf (stderr, "MiniGUI: Init MSG queue error!\n"); goto failure; } return TRUE; failure: return FALSE; }
static void ItemStorage_GoBackToItemPCMenu(u8 taskId, u8 var) { s16 *data = TASK.data; ClearVerticalScrollIndicatorPalettes(); LoadScrollIndicatorPalette(); ItemStorage_LoadPalette(); Menu_DrawStdWindowFrame(0xF, 0, 0x1D, 0x13); Menu_DrawStdWindowFrame(0, 0xC, 0xE, 0x13); Menu_DrawStdWindowFrame(0, 0, 0xB, 3); ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[0].itemId); Menu_PrintText(gPCText_ItemPCOptionsText[var].text, 1, 1); ItemStorage_DrawItemList(taskId); InitMenu(0, 0x10, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); }
static void PASCAL FAR TTXModifyMenu(HMENU menu) { MENUITEMINFO mi; if (pvar->MenuItems > 0) { InitMenu(); memset(&mi, 0, sizeof(mi)); mi.cbSize = sizeof(mi); mi.fMask = MIIM_TYPE | MIIM_SUBMENU; mi.fType = MFT_STRING; mi.hSubMenu = pvar->ResizeMenu; mi.dwTypeData = "Resi&ze"; InsertMenuItem(menu, ID_HELPMENU, FALSE, &mi); } }
CFrmGroupChatList::CFrmGroupChatList(QWidget *parent) : QFrame(parent), m_GroupList(this), ui(new Ui::CFrmGroupChatList) { ui->setupUi(this); QDesktopWidget *pDesk = QApplication::desktop(); move((pDesk->width() - width()) / 2, (pDesk->height() - height()) / 2); bool check = false; m_pAction = NULL; InitMenu(); m_pModel = new QStandardItemModel(this); if(m_pModel) { //增加头,只有增加了这个后,下面才会显示内容 m_pModel->setHorizontalHeaderLabels(QStringList() << tr("Rooms")<< tr("Information")); } //禁止列表文本框编辑 m_GroupList.setEditTriggers(QAbstractItemView::NoEditTriggers); m_GroupList.setModel(m_pModel); m_GroupList.show(); check = connect(&m_GroupList, SIGNAL(customContextMenuRequested(QPoint)), SLOT(slotCustomContextMenuRequested(QPoint))); Q_ASSERT(check); check = connect(&CGlobal::Instance()->GetXmppClient()->m_MucManager, SIGNAL(invitationReceived(QString,QString,QString)), SLOT(slotInvitationReceived(QString,QString,QString))); Q_ASSERT(check); /*check = connect(&CGlobal::Instance()->GetXmppClient()->m_MucManager, SIGNAL(roomAdded(QXmppMucRoom*)), SLOT(slotRoomAdded(QXmppMucRoom*))); Q_ASSERT(check);*/ check = connect(&m_GroupList, SIGNAL(clicked(QModelIndex)), SLOT(slotClicked(QModelIndex))); Q_ASSERT(check); check = connect(&m_GroupList, SIGNAL(doubleClicked(QModelIndex)), SLOT(slotDoubleClicked(QModelIndex))); Q_ASSERT(check); }
LRESULT CALLBACK HookMsgProc(int nCode, WPARAM wParam, LPARAM lParam) { const CWPSTRUCT* p = (const CWPSTRUCT*)lParam; if ((nCode >= 0) && (nCode == HC_ACTION)) { if (g_hWndVDub == 0) InitMainWindow(p->hwnd); if (g_bInitWindow && !g_hMenuAuo) InitMenu(); if (g_bInitOutput && g_bOutput && g_bStartServer) { g_bOutput = false; g_hWorkThread = (HANDLE)_beginthreadex(NULL, 0, OutputThread, NULL, 0, NULL); } } return CallNextHookEx(g_hHook, nCode, wParam, lParam); }
void ScreenOptionsMaster::Init() { vector<RString> asLineNames; split( LINE_NAMES, ",", asLineNames ); if( asLineNames.empty() ) { LuaHelpers::ReportScriptErrorFmt("\"%s:LineNames\" is empty.", m_sName.c_str()); } if( FORCE_ALL_PLAYERS ) { FOREACH_PlayerNumber( pn ) GAMESTATE->JoinPlayer( pn ); } if( NAVIGATION_MODE == "toggle" ) SetNavigation( PREFSMAN->m_iArcadeOptionsNavigation? NAV_TOGGLE_THREE_KEY:NAV_TOGGLE_FIVE_KEY ); else if( NAVIGATION_MODE == "menu" ) SetNavigation( NAV_THREE_KEY_MENU ); SetInputMode( StringToInputMode(INPUT_MODE) ); // Call this after enabling players, if any. ScreenOptions::Init(); vector<OptionRowHandler*> OptionRowHandlers; for( unsigned i = 0; i < asLineNames.size(); ++i ) { RString sLineName = asLineNames[i]; RString sRowCommands = LINE(sLineName); Commands cmds; ParseCommands( sRowCommands, cmds, false ); OptionRowHandler *pHand = OptionRowHandlerUtil::Make( cmds ); if( pHand == NULL ) { LuaHelpers::ReportScriptErrorFmt("Invalid OptionRowHandler \"%s\" in \"%s:Line:%s\".", cmds.GetOriginalCommandString().c_str(), m_sName.c_str(), sLineName.c_str()); } else { OptionRowHandlers.push_back( pHand ); } } InitMenu( OptionRowHandlers ); }
/* ******************************************************************* * Function: void PluginCallback( PluginInfo::CALLBACK_REASON reason, PluginInterface* thePluginInterface ) * * Description : The main plugin callback for Virtools Dev * * * Parameters : * reason r Message passed to the callback * thePluginInterface r The plugin interface pointer * Returns : * ******************************************************************* */ void PluginCallback( PluginInfo::CALLBACK_REASON reason, PluginInterface* thePluginInterface ) { switch( reason ) { case PluginInfo::CR_LOAD: { thePluginInterfaceObject = thePluginInterface; [!if MainMenuCB] InitMenu() ; UpdateMenu() ; [!endif] [!if KeyboardShortcutsCB] RegisterKeyboardShortcutCategory() ; RegisterKeyboardShortcuts() ; [!endif] [!if VariablesCB] InitializeVariables() ; [!endif] } break; case PluginInfo::CR_UNLOAD: { [!if MainMenuCB] RemoveMenu() ; [!endif] [!if KeyboardShortcutsCB] UnregisterKeyboardShortcutCategory() ; [!endif] [!if VariablesCB] DeinitializeVariables() ; [!endif] thePluginInterfaceObject = NULL; } break; case PluginInfo::CR_NEWCOMPOSITIONNAME: { } break; [!if GetNotificationsCB] case PluginInfo::CR_NOTIFICATION: { } break; [!endif] } }
bool COxCJ4UILayer::init() { if (!CLayerBase::init()) return false; CCSize size = this->getContentSize(); CCPoint midPoint = ccp(size.width / 2, size.height / 2); CCPoint bkPoint[4]; bkPoint[0] = ccp(midPoint.x - 475,midPoint.y - 288); bkPoint[1] = ccp(midPoint.x - 560, midPoint.y); bkPoint[2] = ccp(midPoint.x, midPoint.y + 280); bkPoint[3] = ccp(midPoint.x + 553, midPoint.y); InitMenu(); RestAllMenu(); return true; }
void ScreenNetworkOptions::Init() { ScreenOptions::Init(); vector<OptionRowHandler*> vHands; { OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull(); vHands.push_back( pHand ); pHand->m_Def.m_sName = "Connection"; pHand->m_Def.m_bOneChoiceForAllPlayers = true; if ( NSMAN->useSMserver ) pHand->m_Def.m_vsChoices.push_back(CLIENT_DISCONNECT); else pHand->m_Def.m_vsChoices.push_back(CLIENT_CONNECT); } { OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull(); vHands.push_back( pHand ); pHand->m_Def.m_sName = "Scoreboard"; pHand->m_Def.m_vsChoices.clear(); pHand->m_Def.m_bOneChoiceForAllPlayers = true; pHand->m_Def.m_vsChoices.push_back(SCORE_OFF); pHand->m_Def.m_vsChoices.push_back(SCORE_ON); } { // Get info on all received servers from NSMAN. AllServers.clear(); NSMAN->GetListOfLANServers( AllServers ); if( !AllServers.empty() ) { OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull(); pHand->m_Def.m_sName = "Servers"; pHand->m_Def.m_bAllowThemeItems = false; for( unsigned int j = 0; j < AllServers.size(); j++ ) pHand->m_Def.m_vsChoices.push_back( AllServers[j].Name ); vHands.push_back( pHand ); } } InitMenu( vHands ); m_pRows[PO_SCOREBOARD]->SetOneSharedSelection(PREFSMAN->m_bEnableScoreboard); }
bool wxConvertApp::OnInit() { //Initialize all image loaders(JPEG,BMP,PNG,and etc) wxInitAllImageHandlers(); SetAppName(_T("wxConvertApp")); if (HandleCommandLine()) return true; // Create the main frame window m_pFrame = new wxMainFrame(NULL, wxID_ANY, _T("wxConvertApp"), wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL); InitMenu(); m_pFrame->Show(true); SetTopWindow(m_pFrame); return true; }
static void ItemStorage_HandleRemoveItem(u8 taskId) { s16 *data = TASK.data; s16 oldNumItems; if(gMain.newKeys & A_BUTTON || gMain.newKeys == B_BUTTON) { RemovePCItem(PAGE_INDEX + ITEMS_ABOVE_TOP, NUM_QUANTITY_ROLLER); oldNumItems = NUM_ITEMS; NUM_ITEMS = CountUsedPCItemSlots(); if(oldNumItems != NUM_ITEMS && oldNumItems < NUM_PAGE_ITEMS + ITEMS_ABOVE_TOP && ITEMS_ABOVE_TOP != 0) ITEMS_ABOVE_TOP--; ItemStorage_SetItemAndMailCount(taskId); ItemStorage_HandleResumeProcessInput(taskId); InitMenu(0, 16, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); } }
global void KRestartGame() { /* Get rid of our internal stuff. */ static int varyList[] = {1,PALVARYKILL}; DoSound(SProcess,FALSE); gameRestarted = 1; gameStarted = FALSE; /* Turn off PalVary */ if (palVaryOn) { palVaryOn = FALSE; palettePercent = 0; KPalVary(varyList); } KillAllSounds(); DisposeAllScripts(); DisposeLastCast(); /* SetDebug(FALSE); */ /* free all memory */ ResUnLoad(RES_MEM, ALL_IDS); /* Restore the heap and saved vars to what they were before the call * to PMachine. */ RestartHeap(); /* Regenerate the 'patchable resources' table */ InitPatches(); InitMenu(); DoSound(SProcess,TRUE); DoSound(SSetReverb,0); reverbDefault = 0; /* Now restore the stack and restart the PMachine. */ longjmp(restartBuf, 1); }
int main() { ResizeWindow(800, 600); SetConsoleTitle(TEXT("Weather Forecast")); HideCursor(); PrintTitle(); bool quit; for (;;) { wstring city; switch (InitMenu()) { case 0: quit = false; cls(); Center(25, true); cout << "Enter city name: "; ShowCursor(); while (city.size() == 0) Input(city); HideCursor(); while (!quit) switch (MainMenu()) { case 0: CurrentWeather(city); break; case 1: FiveDayForecast(city); break; case 2: DailyForecast(city); break; case 3: quit = true; } break; case 1: return 0; } } }
int main() { state GameState; Game* MyGame; Menu* MyMenu; GameState = MENU; if(_InitAllegro()==0) // allegro init-je { while(STOP_GAME != 1) { switch(GameState) { case MENU: MyMenu = InitMenu(); MenuLoop(MyMenu); //amig a menuben vagyunk a menu loopon belul fut a program FreeMenu(MyMenu); GameState = GAME; break; case GAME: MyGame = _InitGame("resource.txt"); // a játék initje _GameLoop(MyGame); //amig a jatek fut, a Game loopon belul fog az futni // _FreeMyGame(MyGame); ez nem szuksegse, a game loop ugy lep ki, hogy felszabaditja GameState = MENU; break; } } } // játék loop return 0; }
//------------------------------------------------------------------------------ BMenuField::BMenuField(BRect frame, const char *name, const char *label, BMenu *menu, uint32 resize, uint32 flags) : BView(frame, name, resize, flags) { InitObject(label); SetFont(be_plain_font); fMenu = menu; InitMenu(menu); frame.OffsetTo(0.0f, 0.0f); fMenuBar = new _BMCMenuBar_(BRect(frame.left + fDivider + 2.0f, frame.top + kVMargin, frame.right - 2.0f, frame.bottom - kVMargin), false, this); AddChild(fMenuBar); fMenuBar->AddItem(menu); fMenuBar->SetFont(be_plain_font); InitObject2(); }
EditorBase::EditorBase( QWidget* parent, const char* name, Qt::WFlags f ) : QMainWindow( parent, f ), mMainView(0), mWorldManager(0), mTime(0), mLastTime(0) { mInstance = this; setObjectName(name); setWindowTitle("Gamedesk Editor"); statusBar()->showMessage(tr("Ready")); InitActions(); InitMenu(); QBrush bgBrush( QColor( 0, 0, 0 ) ); mWorldManager = GD_NEW(WorldManager, this, "EditorLib::EditorBase"); LoadTools(); }
void BMenuField::_InitMenuBar(BMenu* menu, BRect frame, bool fixedSize) { CALLED(); fMenu = menu; InitMenu(menu); if ((Flags() & B_SUPPORTS_LAYOUT)) { fMenuBar = new _BMCMenuBar_(fixedSize, this); } else { frame.left = _MenuBarOffset(); frame.top = kVMargin; frame.right -= kVMargin; frame.bottom -= kVMargin; TRACE("frame(%.1f, %.1f, %.1f, %.1f) (%.2f, %.2f)\n", frame.left, frame.top, frame.right, frame.bottom, frame.Width(), frame.Height()); fMenuBar = new _BMCMenuBar_(frame, fixedSize, this); } if (fixedSize) { // align the menu bar in the full available space fMenuBar->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_VERTICAL_UNSET)); } else { // align the menu bar left in the available space fMenuBar->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET)); } AddChild(fMenuBar); fMenuBar->AddItem(menu); fMenuBar->SetFont(be_plain_font); }
int ModulesLoaded(WPARAM wParam, LPARAM lParam) { lib_cs_lock(); otr_user_state = otrl_userstate_create(); // this calls ReadPrivkeyFiles (above) to set filename values (also called on ME_FOLDERS_PATH_CHANGED) InitOptions(); InitDBFilter(); InitMenu(); InitSRMM(); hEventWindow = HookEvent(ME_MSG_WINDOWEVENT, WindowEvent); if (options.bHaveSecureIM && !db_get_b(0, MODULENAME, "sim_warned", 0)) { db_set_b(0, MODULENAME, "sim_warned", 1); options.default_policy = OTRL_POLICY_MANUAL_MOD; SaveOptions(); MessageBox(0, TranslateT(LANG_OTR_SECUREIM_TEXT), TranslateT(LANG_OTR_SECUREIM_TITLE), 0x30); } return 0; }
int NewsAggrInit(WPARAM, LPARAM) { if (hNewsAggregatorFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("News Aggregator"), MIRANDA_USERDATAT _T("\\Avatars\\")_T(DEFAULT_AVATARS_FOLDER))) FoldersGetCustomPathT(hNewsAggregatorFolder, tszRoot, MAX_PATH, _T("")); else mir_tstrncpy(tszRoot, VARST( _T("%miranda_userdata%\\Avatars\\" _T(DEFAULT_AVATARS_FOLDER))), _countof(tszRoot)); for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1)) db_set_dw(hContact, MODULE, "LastCheck", time(NULL)); SetContactStatus(hContact, ID_STATUS_ONLINE); } NetlibInit(); InitMenu(); HookEvent(ME_TTB_MODULELOADED, OnToolbarLoaded); HookEvent(ME_FOLDERS_PATH_CHANGED, OnFoldersChanged); // timer for the first update timerId = SetTimer(NULL, 0, 10000, timerProc2); // first update is 10 sec after load return 0; }
CFrmUserList::CFrmUserList(QWidget *parent) : QFrame(parent), COperateRoster(), m_UserList(this), ui(new Ui::CFrmUserList) { ui->setupUi(this); InitMenu(); m_pModel = new QStandardItemModel(this); if(m_pModel) { //增加头,只有增加了这个后,下面才会显示内容 m_pModel->setHorizontalHeaderLabels(QStringList() << tr("User name or group")<< tr("Information")); } m_UserList.setModel(m_pModel); m_UserList.show(); ItemInsertGroup(tr("My friends")); bool check = connect(&m_UserList, SIGNAL(clicked(QModelIndex)), SLOT(clicked(QModelIndex))); Q_ASSERT(check); check = connect(&m_UserList, SIGNAL(doubleClicked(QModelIndex)), SLOT(doubleClicked(QModelIndex))); Q_ASSERT(check); check = connect(&m_UserList, SIGNAL(customContextMenuRequested(QPoint)), SLOT(slotCustomContextMenuRequested(QPoint))); Q_ASSERT(check); check = connect(&m_UserList, SIGNAL(entered(QModelIndex)), SLOT(slotEntered(QModelIndex))); Q_ASSERT(check); check = connect(m_pModel, SIGNAL(itemChanged(QStandardItem*)), SLOT(slotItemChanged(QStandardItem*))); Q_ASSERT(check); check = connect(CGlobal::Instance()->GetMainWindow(), SIGNAL(sigMenuInitOperator(QMenu*)), SLOT(slotAddToMainMenu(QMenu*))); Q_ASSERT(check); check = connect(CGlobal::Instance()->GetMainWindow(), SIGNAL(sigRefresh()), SLOT(slotRefresh())); Q_ASSERT(check); check = connect(CGlobal::Instance()->GetMainWindow(), SIGNAL(sigMenuRemoveOperator(QMenu*)), SLOT(slotDeleteFromMainMenu(QMenu*))); Q_ASSERT(check); check = connect(GET_CLIENT.data(), SIGNAL(sigChangedStatus(const QString&)), SLOT(SlotChangedStatus(const QString&))); Q_ASSERT(check); check = connect(GET_CLIENT.data(), SIGNAL(sigLoadRosterFromStorage()), SLOT(slotLoadRosterFromStorage())); Q_ASSERT(check); check = connect(GET_CLIENT.data(), SIGNAL(sigUpdateRosterUserInfo(QString,QSharedPointer<CUser>)), SLOT(slotUpdateRosterUserInfo(QString,QSharedPointer<CUser>))); Q_ASSERT(check); check = connect(GET_CLIENT.data(), SIGNAL(sigRosterAddReceived(const QString&, const CClient::SUBSCRIBE_TYPE &)), SLOT(slotRosterAddReceived(const QString&, const CClient::SUBSCRIBE_TYPE &))); Q_ASSERT(check); check = connect(GET_CLIENT.data(), SIGNAL(sigRemoveRosterUserInfo(QString)), SLOT(slotRemoveRosterUserInfo(QString))); Q_ASSERT(check); check = connect(GET_CLIENT.data(), SIGNAL(sigMessageUpdate(QString)), SLOT(slotMessageUpdate(QString))); Q_ASSERT(check); check = connect(GET_CLIENT.data(), SIGNAL(sigMessageClean(QString)), SLOT(slotMessageUpdate(QString))); Q_ASSERT(check); }
void ScreenOptionsMaster::Init() { ScreenOptions::Init(); // make sure volume is set to full in options, and menu lights are on ScreenAttract::SetAttractVolume( false ); LIGHTSMAN->SetLightsMode( LIGHTSMODE_MENU ); CStringArray asLineNames; split( LINE_NAMES, ",", asLineNames ); if( asLineNames.empty() ) RageException::Throw( "%s::LineNames is empty.", m_sName.c_str() ); CStringArray Flags; split( OPTION_MENU_FLAGS, ";", Flags, true ); InputMode im = INPUTMODE_INDIVIDUAL; for( unsigned i = 0; i < Flags.size(); ++i ) { CString sFlag = Flags[i]; sFlag.MakeLower(); if( sFlag == "together" ) im = INPUTMODE_SHARE_CURSOR; else if( sFlag == "explanations" ) ; else if( sFlag == "forceallplayers" ) { FOREACH_PlayerNumber( pn ) GAMESTATE->m_bSideIsJoined[pn] = true; GAMESTATE->m_MasterPlayerNumber = PlayerNumber(0); } else if( sFlag == "smnavigation" ) SetNavigation( NAV_THREE_KEY_MENU ); else if( sFlag == "toggle" || sFlag == "firstchoicegoesdown" ) SetNavigation( PREFSMAN->m_bArcadeOptionsNavigation? NAV_TOGGLE_THREE_KEY:NAV_TOGGLE_FIVE_KEY ); else RageException::Throw( "Unknown flag \"%s\"", sFlag.c_str() ); } vector<OptionRowDefinition> OptionRowDefs; OptionRowDefs.resize( asLineNames.size() ); OptionRowHandlers.resize( asLineNames.size() ); for( unsigned i = 0; i < asLineNames.size(); ++i ) { CString sLineName = asLineNames[i]; OptionRowDefinition &def = OptionRowDefs[i]; CString sRowCommands = LINE(sLineName); OptionRowHandler* &pHand = OptionRowHandlers[i]; pHand = NULL; Commands vCommands; ParseCommands( sRowCommands, vCommands ); if( vCommands.v.size() != 1 ) RageException::Throw( "Parse error in %s::Line%s", m_sName.c_str(), sLineName.c_str() ); Command& command = vCommands.v[0]; pHand = OptionRowHandlerUtil::Make( command, def ); if( pHand == NULL ) RageException::Throw( "Invalid OptionRowHandler '%s' in %s::%s", command.GetOriginalCommandString().c_str(), m_sName.c_str(), sLineName.c_str() ); } ASSERT( OptionRowHandlers.size() == asLineNames.size() ); InitMenu( im, OptionRowDefs, OptionRowHandlers ); }
MRESULT EXPENTRY ClkWndProc (HWND hwnd, ULONG usMsg, MPARAM mp1, MPARAM mp2) { switch (usMsg) { case WM_CREATE: ClkCreate (hwnd); return (WinDefWindowProc (hwnd, usMsg, mp1, mp2)); case WM_DESTROY: ClkDestroy (hwnd); return (WinDefWindowProc (hwnd, usMsg, mp1, mp2)); case WM_TIMER: ClkTimer (hwnd); if ( (BOOL) hDateTime) WinSendMsg (hDateTime, WM_TIMER, mp1, mp2); break; case WM_PAINT: ClkPaint (hwnd); break; case WM_MINMAXFRAME: ClkMinmax (hwnd, (PSWP)mp1); break; case WM_SIZE: ClkSize (hwnd); return (WinDefWindowProc (hwnd, usMsg, mp1, mp2)); case WM_COMMAND: ClkCommand (hwnd, mp1,mp2); break; case WM_BUTTON1DOWN: return WinSendMsg (hwndFrame, WM_TRACKFRAME, MPFROMSHORT((USHORT)mp2 | TF_MOVE), MPVOID); case WM_BUTTON1DBLCLK: if (cp.fControlsHidden) ClkShowFrameControls (hwndFrame); else ClkHideFrameControls (hwndFrame); break; case WM_TRANSLATEACCEL: return WinSendMsg(hwndFrame, usMsg, mp1, mp2); break; case WM_SAVEAPPLICATION: /***********************************************************\ * Task Manager option to Save Desktop sends this message. * Save window state (MIN/RESTORE) and position in OS2.INI \***********************************************************/ SaveApplication (hwndFrame); break; case WM_INITMENU: InitMenu(mp1, mp2); break; case HM_QUERY_KEYS_HELP: return (MRESULT)PANEL_HELPKEYS; /* return id of key help panel */ break; default: /* let default window procedure handle it. */ return (WinDefWindowProc (hwnd, usMsg, mp1, mp2)); } return (MRFROMLONG(0)); }
CTEKWindow::CTEKWindow() { WNDCLASS wc; RECT rect; DWORD Style; int fuLoad = LR_DEFAULTCOLOR; if (! LoadTTTEK()) { return; } TEKInit(&tk, &ts); if (ts.HideTitle>0) { Style = WS_POPUP | WS_THICKFRAME | WS_BORDER; } else { Style = WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_BORDER | WS_THICKFRAME; } wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = AfxWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = AfxGetInstanceHandle(); wc.hIcon = NULL; wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hbrBackground = NULL; wc.lpszMenuName = NULL; wc.lpszClassName = TEKClassName; RegisterClass(&wc); if (ts.TEKPos.x==CW_USEDEFAULT) { rect = rectDefault; } else { rect.left = ts.TEKPos.x; rect.top = ts.TEKPos.y; rect.right = rect.left + 640; //temporary width rect.bottom = rect.top + 400; //temporary height } Create(TEKClassName, "Tera Term", Style, rect, GetDesktopWindow(), NULL); //-------------------------------------------------------- HTEKWin = GetSafeHwnd(); if (HTEKWin == NULL) { return; } tk.HWin = HTEKWin; // register this window to the window list RegWin(HVTWin,HTEKWin); if (is_NT4()) { fuLoad = LR_VGACOLOR; } ::PostMessage(HTEKWin,WM_SETICON,ICON_SMALL, (LPARAM)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE((ts.TEKIcon!=IdIconDefault)?ts.TEKIcon:IDI_TEK), IMAGE_ICON,16,16,fuLoad)); ::PostMessage(HTEKWin,WM_SETICON,ICON_BIG, (LPARAM)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE((ts.TEKIcon!=IdIconDefault)?ts.TEKIcon:IDI_TEK), IMAGE_ICON, 0, 0, fuLoad)); MainMenu = NULL; WinMenu = NULL; if ((ts.HideTitle==0) && (ts.PopupMenu==0)) { InitMenu(&MainMenu); ::SetMenu(HTEKWin,MainMenu); } ChangeTitle(); ::GetWindowRect(tk.HWin,&rect); TEKResizeWindow(&tk,&ts, rect.right-rect.left, rect.bottom-rect.top); if ((ts.PopupMenu>0) || (ts.HideTitle>0)) { ::PostMessage(HTEKWin,WM_USER_CHANGEMENU,0,0); } ::ShowWindow(tk.HWin, SW_SHOWNORMAL); }
bool C4Menu::DoInitRefSym(const C4Facet &fctSymbol, const char *szEmpty, int32_t iExtra, int32_t iExtraData, int32_t iId, int32_t iStyle) { Clear(); Default(); Symbol.Set(fctSymbol); return InitMenu(szEmpty, iExtra, iExtraData, iId, iStyle); }
bool C4Menu::DoInit(C4FacetSurface &fctSymbol, const char *szEmpty, int32_t iExtra, int32_t iExtraData, int32_t iId, int32_t iStyle) { Clear(); Default(); Symbol.GrabFrom(fctSymbol); return InitMenu(szEmpty, iExtra, iExtraData, iId, iStyle); }