void TTb::AddTb(const PTb& Tb){ Assert(GetVars()==Tb->GetVars()); for (int VarN=0; VarN<GetVars(); VarN++){ Assert(*GetVar(VarN)==*(Tb->GetVar(VarN))); } for (int SrcTupN=0; SrcTupN<Tb->GetTups(); SrcTupN++){ int DstTupN=AddTup(Tb->GetTupNm(SrcTupN)); for (int VarN=0; VarN<Tb->GetVars(); VarN++){ PutVal(DstTupN, VarN, Tb->GetVal(SrcTupN, VarN));} } }
int TGTb::AddTup(const TStr& Nm){ Assert(GetVars()>0); TStr UniqNm=Nm; if (UniqNm.Empty()){UniqNm=TStr("E")+TInt::GetStr(TupV.Len());} if (TupNmToNH.IsKey(UniqNm)){ int CopyN=2; while (TupNmToNH.IsKey(UniqNm+" ("+TInt::GetStr(CopyN)+")")){CopyN++;} UniqNm=UniqNm+" ("+TInt::GetStr(CopyN)+")"; } Assert(!TupNmToNH.IsKey(UniqNm)); int TupN=TupV.Add(PTbTup(new TGTbTup(UniqNm, GetVars()))); TupNmToNH.AddDat(UniqNm, TupN); return TupN; }
void COXCustomizeTabbedMDIPage::OnInitDialog() { // must call default implementation COXCustomizePage::OnInitDialog(); // add here initialization code for your demo dialog. Treat it as a // normal CDialog::OnInitDialog function // spin control m_spinOffset.SetRange(0,1000); GetVars(); // layout // m_LayoutManager.TieChild(&m_treeTabCtrlSettings,OX_LMS_ANY,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_STATIC_OFFSET,OX_LMS_BOTTOM,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_EDIT_OFFSET,OX_LMS_BOTTOM,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_SPIN_OFFSET,OX_LMS_BOTTOM,OX_LMT_SAME); // /////////////////////////////////////// m_bInitialized=TRUE; UpdateData(FALSE); OnCheckSupportTabbedmdi(); }
void COXCustomizeToolbarsPage::OnInitDialog() { // must call default implementation COXCustomizePage::OnInitDialog(); // add here initialization code for your demo dialog. Treat it as a // normal CDialog::OnInitDialog function // separator controls COLORREF clr=::GetSysColor(COLOR_WINDOW); m_sepToolbars.SetTextColor(clr); m_sepOptions.SetTextColor(clr); m_sepOperations.SetTextColor(clr); // spin control m_spinBorderSize.SetRange(0,1000); GetVars(); // layout // m_LayoutManager.TieChild(&m_treeToolbars,OX_LMS_ANY,OX_LMT_SAME); m_LayoutManager.TieChild(&m_sepToolbars,OX_LMS_LEFT|OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(&m_sepOperations,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(&m_sepOptions,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_BUTTON_NEW,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_BUTTON_DELETE,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_BUTTON_RENAME,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_BUTTON_RESET,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_BUTTON_RESET_ALL,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_CHECK_TOOLTIPS,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_CHECK_COOL,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_CHECK_GRIPPER,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_STATIC_BORDER_SIZE,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_EDIT_BORDER_SIZE,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_SPIN_BORDER_SIZE,OX_LMS_RIGHT,OX_LMT_SAME); // /////////////////////////////////////// // If the OfficeXP skin is on disable the CoolLook checkbox COXSkinnedApp* pSkinnedApp = DYNAMIC_DOWNCAST(COXSkinnedApp, AfxGetApp()); if (pSkinnedApp != NULL) { COXSkin* pCurrentSkin = pSkinnedApp->GetCurrentSkin(); if (pCurrentSkin != NULL) if (pCurrentSkin->GetName() == _T("Office XP")) { CButton* pBtn = (CButton*) GetDlgItem(IDC_OX_CHECK_COOL); pBtn->SetCheck(TRUE); pBtn->EnableWindow(FALSE); } } m_bInitialized=TRUE; UpdateState(); }
void COXCustomizeCaptionPage::OnSelchangeComboCaptionState() { // TODO: Add your control notification handler code here if(!UpdateData(TRUE)) return; // SetVars(); GetVars(FALSE); // UpdateData(FALSE); }
void TTb::SaveAssis(const TStr& FNm){ TStr DoFNm=FNm.GetFPath()+"AsDo"+FNm.GetFMid().GetSubStr(0, 3)+".Dat"; TStr DaFNm=FNm.GetFPath()+"AsDa"+FNm.GetFMid().GetSubStr(0, 3)+".Dat"; TOLx DoLx(PSOut(new TFOut(DoFNm)), TFSet()|oloFrcEoln|oloSigNum|oloUniStr); int Dscs=GetVar(0)->GetVarType()->GetDscs(); Assert(Dscs>0); DoLx.PutInt(Dscs); DoLx.PutDosLn(); for (int DscN=0; DscN<Dscs; DscN++){ TTbVal Val=GetVar(0)->GetVarType()->GetVal(DscN); DoLx.PutStr(GetVar(0)->GetVarType()->GetValStr(Val)); DoLx.PutDosLn(); } DoLx.PutInt(TInt(GetVars()-1)); DoLx.PutDosLn(); for (int VarN=1; VarN<GetVars(); VarN++){ DoLx.PutStr(GetVar(VarN)->GetNm()); DoLx.PutDosLn(); int Dscs=GetVar(VarN)->GetVarType()->GetDscs(); if (Dscs>0){ DoLx.PutInt(Dscs); DoLx.PutDosLn(); for (int DscN=0; DscN<Dscs; DscN++){ TTbVal Val=GetVar(VarN)->GetVarType()->GetVal(DscN); DoLx.PutStr(GetVar(VarN)->GetVarType()->GetValStr(DscN)); DoLx.PutDosLn();} } else { DoLx.PutInt(TInt(0)); DoLx.PutInt(TInt(100)); DoLx.PutDosLn(); } } TOLx DaLx(PSOut(new TFOut(DaFNm)), TFSet()|oloFrcEoln|oloSigNum|oloUniStr); for (int TupN=0; TupN<GetTups(); TupN++){ for (int VarN=0; VarN<GetVars(); VarN++){ TTbVal Val=GetVal(TupN, VarN); switch (Val.GetValTag()){ case tvtUnknw: DaLx.PutSym(syQuestion); break; case tvtUnimp: DaLx.PutSym(syAsterisk); break; case tvtUnapp: DaLx.PutSym(syAsterisk); break; case tvtDsc: DaLx.PutInt(TInt(1+Val.GetDsc())); break; case tvtFlt: DaLx.PutFlt(Val.GetFlt()); break; default: Fail; } } DaLx.PutDosLn(); } }
void TTb::SaveTxt(const TStr& FNm, const bool& SaveTupNm){ TOLx Lx(PSOut(new TFOut(FNm)), TFSet()|oloFrcEoln|oloSigNum|oloUniStr|oloTabSep); if (SaveTupNm){Lx.PutStr("Name");} for (int VarN=0; VarN<GetVars(); VarN++){ Lx.PutStr(GetVar(VarN)->GetNm());} Lx.PutLn(); for (int TupN=0; TupN<GetTups(); TupN++){ if (SaveTupNm){Lx.PutStr(GetTupNm(TupN));} for (int VarN=0; VarN<GetVars(); VarN++){ TTbVal Val=GetVal(TupN, VarN); switch (Val.GetValTag()){ case tvtUnknw: Lx.PutSym(syQuestion); break; case tvtUnimp: Lx.PutSym(syAsterisk); break; case tvtUnapp: Lx.PutSym(sySlash); break; case tvtDsc: Lx.PutStr(GetVar(VarN)->GetVarType()->GetValStr(Val)); break; case tvtFlt: Lx.PutFlt(Val.GetFlt()); break; default: Fail; } } Lx.PutLn(); } }
bool SqwBase::SetVarIfAvail(const std::string& strKey, const std::string& strNewVal) { std::vector<t_var> vecVars = GetVars(); for(const t_var& var : vecVars) { if(strKey == std::get<0>(var)) { t_var varNew = var; std::get<2>(varNew) = strNewVal; SetVars(std::vector<t_var>({varNew})); return true; } } return false; }
BOOL CNucAge::ProcessState(E_STATE eState, DWORD dwCurrTick) { switch (eState.dwStateID) { case ES_STARTENGINE: // init resources AddResource("data\\cursor.dat", "cursor"); AddResource("data\\sand.dat", "sand"); AddResource("data\\actor.dat", "actor"); AddResource("data\\gamegui.dat", "gamegui"); // init scenes AddScene("scenes\\gamegui.scn", "gamegui", "gamegui"); AddScene("scenes\\level.scn", "level", "sand"); AddScene("scenes\\actor.scn", "actor", "actor"); // create game objects g_pLevel = new CLevel(); g_pRlPlayer = new CPlayer(); g_pShPlayer = new CPlayer(); g_pGtm = new CGameTime(); g_pKeys = new CKeys(); g_pMenu = new CGameMenu(); g_pHelp = new CHelpDlg(); g_pOptions = new COptionsDlg(); // set players name strcpy(g_pRlPlayer->m_szName, "rlplayer"); strcpy(g_pShPlayer->m_szName, "shplayer"); g_pRlPlayer->m_bIsReal = TRUE; g_pShPlayer->m_bIsReal = FALSE; // add mouse support CreateMouse("cursor"); // add listeners GetScene("level")->AddListener(g_pLevel, "main"); GetScene("actor")->AddListener(g_pRlPlayer, g_pRlPlayer->m_szName); GetScene("actor")->AddListener(g_pShPlayer, g_pShPlayer->m_szName); GetScene("gamegui")->AddListener(g_pGtm, "time"); GetScene("gamegui")->AddListener(g_pKeys, "keys"); GetScene("gamegui")->AddListener(g_pMenu, "main"); GetScene("gamegui")->AddListener(g_pHelp, "help"); GetScene("gamegui")->AddListener(g_pOptions, "options"); GetScene("level")->SetVisible(FALSE); GetScene("actor")->SetVisible(FALSE); // create fonts GetScene("gamegui")->GetStringManager()->CreateFont("fonts\\fonts.fnt", "greenfnt"); GetScene("gamegui")->GetStringManager()->CreateFont("fonts\\fonts.fnt", "buttonfnt"); GetScene("gamegui")->GetStringManager()->CreateFont("fonts\\fonts.fnt", "redfnt"); GetScene("gamegui")->GetStringManager()->CreateFont("fonts\\fonts.fnt", "labelfnt"); // init string table GetStringTable()->Init("strings.dat"); GetStringTable()->SetLocale("en"); // init audio GetAudio()->LoadGroup("sfx\\sound.sfx", "sound"); // we start game from menu screen SetRTIntVar(NA_RT_GAME_STATE, GS_MENU); // create game variable object AddVars("game.ini", "config"); // get world size value int iLevel, iWorldSize; GetVars("config")->GetInt(L_GROUP, "config", "worldsize", 0, &iWorldSize); if (iWorldSize <= 0 || iWorldSize > 25) iWorldSize = 25; SetRTIntVar(NA_RT_WORLD_SIZE, iWorldSize); // get current level value GetVars("config")->GetInt(L_GROUP, "config", "curlvl", 0, &iLevel); if (iLevel >= NA_NUM_WORLDS*iWorldSize) iLevel = NA_NUM_WORLDS*iWorldSize - 1; SetRTIntVar(NA_RT_CURR_LEVEL_NUMBER, iLevel); SetRTIntVar(NA_RT_MINI_LEVEL_NUMBER, iLevel); // get maximum achieved number of levels GetVars("config")->GetInt(L_GROUP, "config", "maxlvl", 0, &iLevel); if (iLevel >= NA_NUM_WORLDS*iWorldSize) iLevel = NA_NUM_WORLDS*iWorldSize - 1; SetRTIntVar(NA_RT_MAX_LEVEL_NUMBER, iLevel); // sync current level with max level if (GetRTIntVar(NA_RT_CURR_LEVEL_NUMBER) > iLevel) { SetRTIntVar(NA_RT_CURR_LEVEL_NUMBER, iLevel); SetRTIntVar(NA_RT_MINI_LEVEL_NUMBER, iLevel); } // update audio int iSndVol, iMusVol; BOOL fMute; GetVars("config")->GetInt(L_GROUP, "config", "mute", 0, &fMute); GetVars("config")->GetInt(L_GROUP, "config", "sndvol", 0, &iSndVol); GetVars("config")->GetInt(L_GROUP, "config", "musvol", 0, &iMusVol); GetAudio()->SetSFXVolume(iSndVol); GetAudio()->SetMusicVolume("backlogo", iMusVol); GetAudio()->SetMute(fMute); SetRTStringVar(NA_RT_BACK_MUSIC, "backlogo"); GetAudio()->PlayMusic("backlogo"); //turn on music check PostState(ES_ENGINE_CHECKMUSIC, 0, 0); break; case ES_ENGINE_CHECKMUSIC: //check if back music stop then play it again if (!GetAudio()->IsMusicPlay(GetRTStringVar(NA_RT_BACK_MUSIC))) { GetAudio()->StopMusic(GetRTStringVar(NA_RT_BACK_MUSIC)); GetAudio()->PlayMusic(GetRTStringVar(NA_RT_BACK_MUSIC)); } return FALSE; } return TRUE; }
void COXCustomizeCaptionPage::OnInitDialog() { // must call default implementation COXCustomizePage::OnInitDialog(); // add here initialization code for your demo dialog. Treat it as a // normal CDialog::OnInitDialog function m_btnTextFont.SetBuddy(IDC_OX_STATIC_TEXTFONT); m_btnSmallTextFont.SetBuddy(IDC_OX_STATIC_SMALLTEXTFONT); CString sText; VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_ACTIVESTATE)); m_ctlComboCaptionState.AddString(sText);//"Caption in active state" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_INACTIVESTATE)); m_ctlComboCaptionState.AddString(sText);//"Caption in inactive state" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_LEFT)); m_ctlComboGradientAlignment.AddString(sText);//"Left" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_CENTER)); m_ctlComboGradientAlignment.AddString(sText);//"Center" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_RIGHT)); m_ctlComboGradientAlignment.AddString(sText);//"Right" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_LINEAR)); m_ctlComboGradientAlgorithm.AddString(sText);//"Linear" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_SQUARE)); m_ctlComboGradientAlgorithm.AddString(sText);//"Square" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_TOPLEFT)); m_ctlComboTextAlignment.AddString(sText);//"TopLeft" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_TOPCENTER)); m_ctlComboTextAlignment.AddString(sText);//"TopCenter" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_TOPRIGHT)); m_ctlComboTextAlignment.AddString(sText);//"TopRight" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_CENTERLEFT)); m_ctlComboTextAlignment.AddString(sText);//"CenterLeft" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_CENTER)); m_ctlComboTextAlignment.AddString(sText);//"Center" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_CENTERRIGHT)); m_ctlComboTextAlignment.AddString(sText);//"CenterRight" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_BOTTOMLEFT)); m_ctlComboTextAlignment.AddString(sText);//"BottomLeft" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_BOTTOMCENTER)); m_ctlComboTextAlignment.AddString(sText);//"BottomCenter" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_BOTTOMRIGHT)); m_ctlComboTextAlignment.AddString(sText);//"BottomRight" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_NONE)); m_ctlComboTextEllipsis.AddString(sText);//"None" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_END)); m_ctlComboTextEllipsis.AddString(sText);//"End" VERIFY(sText.LoadString(IDS_OX_CSMZECAPTION_PATH)); m_ctlComboTextEllipsis.AddString(sText);//"Path" m_nCaptionState=0; // spin control GetVars(); m_spinNumberShade.SetRange(1,128); // layout // m_LayoutManager.TieChild(&m_ctlComboCaptionState, OX_LMS_LEFT|OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(&m_separator, OX_LMS_LEFT|OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_STATIC_TEXTFONT, OX_LMS_LEFT|OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_STATIC_SMALLTEXTFONT, OX_LMS_LEFT|OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_GRADIENT_GROUP,OX_LMS_LEFT|OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(&m_ctlComboGradientAlignment, OX_LMS_LEFT|OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(&m_ctlComboGradientAlgorithm, OX_LMS_LEFT|OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_PREVIEW_GROUP, OX_LMS_LEFT|OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_STATIC_PREVIEW, OX_LMS_LEFT|OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME); // /////////////////////////////////////// OnCheckPaintCaption(); UpdateData(); GetVars(); m_bInitialized=TRUE; }
void TGTb::DefVarTypes(){ for (int VarN=0; VarN<GetVars(); VarN++){VarV[VarN]->DefVarType();} }
void COXCustomizeShortkeysPage::OnInitDialog() { // must call default implementation COXCustomizePage::OnInitDialog(); // add here initialization code for your demo dialog. Treat it as a // normal CDialog::OnInitDialog function // separators COLORREF clr=::GetSysColor(COLOR_WINDOW); m_sepShortkeys.SetTextColor(clr); m_sepDescription.SetTextColor(clr); m_sepConflict.SetTextColor(clr); m_sepCommands.SetTextColor(clr); // populate tree GetVars(); // populate table of accelerator contexts COXArrAccelTables* pAccelTables=m_shortkeysOrganizer.GetAccelTables(); ASSERT(pAccelTables!=NULL); if(pAccelTables->GetSize()==0) { // there is no accelerator tables defined for this application // as aresult all controls on this dialog must be disabled CWnd* pWndChild=GetWindow(GW_CHILD); while(pWndChild!=NULL) { pWndChild->EnableWindow(FALSE); pWndChild=pWndChild->GetNextWindow(); } m_bReadOnly=TRUE; } else { for(int nIndex=0; nIndex<pAccelTables->GetSize(); nIndex++) { CString sText=OXDEFAULTACCEL; if(pAccelTables->GetAt(nIndex).m_docTemplate!=NULL) { pAccelTables->GetAt(nIndex).m_docTemplate-> GetDocString(sText,CDocTemplate::docName); } m_comboTable.AddString(sText); } } m_nAccelTableIndex=0; // layout // m_LayoutManager.TieChild(&m_treeCommands,OX_LMS_ANY,OX_LMT_SAME); m_LayoutManager.TieChild(&m_sepCommands, OX_LMS_LEFT|OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(&m_sepDescription, OX_LMS_LEFT|OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_STATIC_DESCRIPTION, OX_LMS_LEFT|OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_SEPARATOR_SHORTKEYS,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_STATIC_FOR,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_COMBO_TABLE,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_STATIC_CURRENT_KEYS,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_LIST_SHORTKEYS, OX_LMS_RIGHT|OX_LMS_BOTTOM|OX_LMS_TOP,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_BUTTON_ASSIGN,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_BUTTON_REMOVE,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_BUTTON_REMOVE_ALL,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_BUTTON_RESET_ALL,OX_LMS_RIGHT,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_STATIC_NEW_KEY, OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_HOTKEY_SHORTKEY, OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_SEPARATOR_CONFLICTS, OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME); m_LayoutManager.TieChild(IDC_OX_STATIC_ASSIGNED_TO, OX_LMS_RIGHT|OX_LMS_BOTTOM,OX_LMT_SAME); // /////////////////////////////////////// UpdateData(FALSE); GetShortkeys(); ShowVars(); m_bInitialized=TRUE; }