void GuiObject::GenerateBackButton(void) { ButtonControl* newcon = new ButtonControl(); newcon->ConnectionID = newcon->TypeHashCode = typeid(ButtonControl).hash_code(); newcon->SetConnection(this); newcon->ConnectionID = 10; conXtor->setConnectables(9,newcon); newcon->SetText(" back"); conXtor->GetConnected<ButtonControl>(10)->PositionOnPanel = VectorF(15,15); conXtor->GetConnected<ButtonControl>(10)->SizeScaledPanel = VectorF(0.4,0.1); conXtor->GetConnected<ButtonControl>(10)->SetClickerFunc(_backButtonClicked); }
/* グローバル(静的)のウィンドウプロシージャ ※ローカル変数へのアクセス不可 */ LRESULT CALLBACK ButtonControl::GlobalButtonProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { ButtonControl *pButtonControl = (ButtonControl*)GetProp(hWnd, SZCECOWIZBUTTONPROC); if (pButtonControl) { return pButtonControl->LocalButtonProc(hWnd, msg, wParam, lParam); } return 0; }
void ChooseServerForm::ShowHide() { ListControl *plstc = (ListControl *)GetControlPtr(kidcServerList); ButtonControl *pbtn = (ButtonControl *)GetControlPtr(kidcOk); int index = plstc->GetSelectedItemIndex(); if (index < 0 || index >= infos_.size()) { pbtn->Show(false); return; } ServerInfo& info = infos_[index]; if (strcmp(info.status.c_str(), "ok") != 0) { pbtn->Show(false); return; } pbtn->Show(true); }
void ButtonsAndTexturesApp::setup() { rotation = 0; screenshot = gl::Texture(getWindowWidth(), getWindowHeight()); //uninitialized texture with random pixels from GPU memory gui = new SimpleGUI(this); gui->lightColor = ColorA(1, 1, 0, 1); gui->addLabel("CONTROLS"); //let's add a button gui->addButton("Restart")->registerClick(this, &ButtonsAndTexturesApp::restartButtonClick); gui->addSeparator(); gui->addLabel("SCREENSHOT"); screenshotTextureControl = gui->addParam("Screenshot", &screenshot); //you can also store reference to it and add callback as a second step takeScreenshotButton = gui->addButton("Take screenshot"); cbTakeScreenshotButtonClick = takeScreenshotButton->registerClick(this, &ButtonsAndTexturesApp::takeScreenshotButtonClick); //to stop listening to click do this: //takeScreenshotButton->unregisterClick(cbTakeScreenshotButtonClick); gui->load(CONFIG_FILE); //we load settings after specifying all the //params because we need to know their name and type timer.start(); prevTime = timer.getSeconds(); }
void DownloadMissionPackForm::HideShow() { ListControl *plstc = (ListControl *)GetControlPtr(kidcMissionPackList); LabelControl *plbl = (LabelControl *)GetControlPtr(kidcMissionPackInfo); ButtonControl *pbtn = (ButtonControl *)GetControlPtr(kidcOk); int selected = plstc->GetSelectedItemIndex(); if (selected < 0) { gppim->Reset(); plbl->SetText(""); pbtn->Show(false); GetControlPtr(kidcDiscuss)->Show(false); return; } // Get the pack info for this pack IndexEntry *entry = (IndexEntry *)plstc->GetSelectedItemData(); if (entry == NULL) { return; } char *psz = NULL; switch (gppackm->IsInstalled(&entry->packid)) { case 0: psz = "DOWNLOAD"; break; case 1: psz = "REMOVE"; break; case 2: psz = "UPGRADE"; break; } if (psz != NULL) { pbtn->SetText(psz); } pbtn->Show(true); ShowInfo(true); }
void MinerGob::InitMenu(Form *pfrm) { ButtonControl *pbtn = (ButtonControl *)pfrm->GetControlPtr(kidcDeliver); pbtn->Show(GetGalaxiteAmount() != 0); }
void RogersGuiApp::setup() { rotation = 0; screenshot = gl::Texture(getWindowWidth(), getWindowHeight()); //uninitialized texture with random pixels from GPU memory IntVarControl *ic; BoolVarControl *bc; PanelControl *pc; ByteVarControl *btc; FlagVarControl *fc; aString = "whatever"; gui = new SimpleGUI(this); gui->lightColor = ColorA(1, 1, 0, 1); gui->addColumn(); gui->addLabel("> READ ONLY"); gui->addSeparator(); gui->addLabel("READONLY"); gui->addParam("String", &aString); // !NEW! Update aString will update label gui->addParam("Window Width", &windowWidth, 0, 1920, getWindowWidth())->setReadOnly(); // !NEW! No slider, just value gui->addParam("Window Height", &windowHeight, 0, 1080, getWindowHeight())->setReadOnly(); // !NEW! No slider, just value gui->addParam("FPS", &FPS, 0, 60, 0)->setReadOnly(); // !NEW! No slider, just value gui->addSeparator(); // Textures gui->addLabel("> TEXTURES"); gui->addSeparator(); takeScreenshotButton = gui->addButton("Take screenshot"); takeScreenshotButton->registerClick(this, &RogersGuiApp::takeScreenshotButtonClick); screenshotTextureControl = gui->addParam("Screenshot", &screenshot); screenshotTextureControl->refreshRate = 0.0; // !NEW! let's refresh manually //screenshotTextureControl->refreshRate = 0.1; // !NEW! use this for movies or syphon //takeScreenshotButton->unregisterClick(cbTakeScreenshotButtonClick); gui->addSeparator(); gui->addParam("Null Texture example", &nullTex); // !NEW! Null textures will be marked so // // ROGER:: From Grouping example gui->addColumn(); gui->addLabel("> CONTROLS"); gui->addSeparator(); gui->addButton("Restart Animation")->registerClick(this, &RogersGuiApp::restartButtonClick); bc = gui->addParam("Auto Rotation ON", &autoRotation, true); bc->nameOff = "Auto Rotation OFF"; // !NEW! Alternative label when OFF gui->addParam("Rotation", &rotation, 0, 360, 0)->setDisplayValue(); gui->addParam("Size", &size, 100, 600, 200)->setDisplayValue(); gui->addParam("Background", &colorBack, Color(0.1, 0.1, 0.5), SimpleGUI::RGB); //use R,G,B,A sliders gui->addParam("Color", &color, ColorA(1, 0.2, 0.2, 0.1), SimpleGUI::RGB); //use R,G,B,A sliders gui->addParam("HSV", &colorBackHSV, Color(0.1, 0.1, 0.5), SimpleGUI::HSV); gui->addParam("HSV+A", &colorHSV, ColorA(1, 0.2, 0.2, 0.1), SimpleGUI::HSV); gui->addSeparator(); gui->addLabel("RENDER TYPE"); gui->addParam("Fill", &fill, true, RENDER_TYPE_GROUP); //if we specify group id, we create radio button set bc = gui->addParam("Stroke", &stroke, false, RENDER_TYPE_GROUP); //i.e. only one of the buttons can be active at any time pc = gui->addPanel(); bc->switchPanel( pc ); // !NEW! Automatically open/close a panel gui->addParam("Thickness", &thickness, 1, 10); // // LIST CONTROL gui->addColumn(); gui->addLabel("> LISTS"); gui->addSeparator(); gui->addButton("Increase List")->registerClick(this, &RogersGuiApp::addToList); gui->addButton("Decrease List")->registerClick(this, &RogersGuiApp::removeFromList); valueLabels[0] = "val 0"; valueLabels[1] = "val 1"; valueLabels[2] = "val 2"; gui->addSeparator(); theDropDownControl = gui->addParamDropDown("Drop-Down List", &listVal, valueLabels); // !NEW! Drop-Down control gui->addSeparator(); theListControl = gui->addParamList("Explicit List", &listVal, valueLabels); // !NEW! List control gui->addSeparator(); gui->addLabel("just a label"); // // INTS CONTROL gui->addColumn(); gui->addLabel("> INTS"); gui->addSeparator(); gui->addParam("Int Radio (<=10)", &intValue1, 1, 3, 0)->setDisplayValue(); // !NEW! small int range will be displayed as radios gui->addParam("Int Radio (<=10)", &intValue2, 1, 10, 0)->setDisplayValue(); // !NEW! small int range will be displayed as radios gui->addParam("Int slider (>10)", &intValue3, 1, 11, 0)->setDisplayValue(); // !NEW! Display the value beside labels // stepped gui->addSeparator(); ic = gui->addParam("Int Step 2", &intValue4, 0, 10, 0); ic->setDisplayValue(); ic->setStep(2); // !NEW! int step ic = gui->addParam("Int Step 2", &intValue5, 0, 18, 0); ic->setDisplayValue(); ic->setStep(2); // !NEW! int step ic = gui->addParam("Int Step 2", &intValue6, 0, 20, 0); ic->setDisplayValue(); ic->setStep(2); // !NEW! int step // // BYTE CONTROL gui->addColumn(); gui->addLabel("> BYTES"); gui->addSeparator(); gui->addParam("Byte", &byteValue1, 0)->setDisplayValue(); // !NEW! ranges from 0-255 btc = gui->addParam("Byte as char", &byteValue2, 0); // !NEW! display as char btc->setDisplayValue(); btc->displayChar = true; btc = gui->addParam("Byte as hex", &byteValue3, 0); // !NEW! display as hex btc->setDisplayValue(); btc->displayHex = true; // FLAGS gui->addSeparator(); fc = gui->addParamFlag("Byte Flag", &flagValue, 8, 0x55); // !NEW! Byte Flag fc->setDisplayValue(); fc->displayHex = true; gui->load(CONFIG_FILE); //we load settings after specifying all the //params because we need to know their name and type timer.start(); prevTime = timer.getSeconds(); }