BOOL KDlg_PropertyDialog::ShowWindow (int nCmdShow) { if((TRUE==nCmdShow)&&(FALSE==m_bShow)) { m_bShow = nCmdShow; CreateUI(); } m_bShow = nCmdShow; int curIndex = m_Tab.GetCurSel(); for(DWORD i=0;i<m_vecPage.size();i++) { m_vecPage[i]->EnableWindow(FALSE); m_vecPage[i]->ShowWindow(FALSE); } if((curIndex>=0)&&(curIndex<(int)m_vecPage.size())) { m_vecPage[curIndex]->EnableWindow(TRUE); m_vecPage[curIndex]->ShowWindow(nCmdShow); //m_vecPage[curIndex]->SetFocus(); } return CDialog::ShowWindow(nCmdShow); }
int main(int argc, char *argv[]) { char *driverSpec = NULL, *optArg; int c; while ((c = AG_Getopt(argc, argv, "?hd:", &optArg, NULL)) != -1) { switch (c) { case 'd': driverSpec = optArg; break; case '?': case 'h': default: printf("Usage: unitconv [-d agar-driver-spec]\n"); return (1); } } if (AG_InitCore("unitconv", 0) == -1 || AG_InitGraphics(driverSpec) == -1) { fprintf(stderr, "%s\n", AG_GetError()); return (1); } AG_BindGlobalKey(AG_KEY_ESCAPE, AG_KEYMOD_ANY, AG_QuitGUI); AG_BindGlobalKey(AG_KEY_F8, AG_KEYMOD_ANY, AG_ViewCapture); CreateUI(); agColors[WINDOW_BG_COLOR] = AG_ColorRGB(60,60,60); AG_EventLoop(); AG_Destroy(); return (0); }
int main(void) { if (!glfwInit()) { fprintf(stderr, "Failed to initialize GLFW\n"); exit(EXIT_FAILURE); } if (!glfwOpenWindow(window_width, window_height, 0, 0, 0, 0, 0, 0, GLFW_WINDOW)) { glfwTerminate(); fprintf(stderr, "Failed to open GLFW window\n"); exit(EXIT_FAILURE); } CreateUI(window_width, window_height); glfwSetWindowTitle("GLFW + SimpleUI"); glfwSetMousePosCallback(mouse_pos_callback); glfwSetMouseButtonCallback(mouse_button_callback); glfwSetWindowSizeCallback(window_size_callback); glfwSwapInterval(1); while (glfwGetWindowParam(GLFW_OPENED)) { Render(); } glfwTerminate(); exit(EXIT_SUCCESS); }
bool AudacityCommand::ShowInterface(wxWindow *parent, bool WXUNUSED(forceModal)) { if (mUIDialog) { if ( mUIDialog->Close(true) ) mUIDialog = nullptr; return false; } // mUIDialog is null auto cleanup = valueRestorer( mUIDialog ); mUIDialog = CreateUI(parent, this); if (!mUIDialog) return false; mUIDialog->Layout(); mUIDialog->Fit(); mUIDialog->SetMinSize(mUIDialog->GetSize()); // The Screenshot command might be popping this dialog up, just to capture it. if( ScreenshotCommand::MayCapture( mUIDialog ) ) return false; bool res = mUIDialog->ShowModal() != 0; return res; }
bool CNodePropertyUI::UpdateTarget() { if (mTargetNode) { mTargetNode->SetName(mNameCtrl->GetValue().ToStdString()); for (TPropTable::iterator iter = mTargetNode->mPropTable.begin(); iter != mTargetNode->mPropTable.end(); iter++) { if ((*iter).mType == std::string("T")) { wxTextCtrl* control = (wxTextCtrl*)FindInControlList((*iter).mName); (*iter).mValue = control->GetValue().ToStdString(); } else if ((*iter).mType == std::string("D")) { // UNIMPLEMENTED!!!!!!!!! } else if ((*iter).mType == std::string("C")) { wxCheckBox* control = (wxCheckBox*)FindInControlList((*iter).mName); if (control->GetValue()) (*iter).mValue = std::string("T"); else (*iter).mValue = std::string("F"); } } // Repaint the whole thing gEnv->MainFrame->PaintFlowEditor(); CreateUI(); return true; } return false; }
BOOL KDlg_PropertyDialog::OnInitDialog() { CDialog::OnInitDialog(); CreateUI(); // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
Player::Player(QWidget *parent) : QWidget(parent) { pos = 0; piece = ""; money = 1200; lostTurn = 0; CreateUI(); }
StartState::StartState(GameManager* gm, Renderer* renderer) : GameState(gm, renderer) , m_startUI(NULL) , m_actStart(NULL) , m_cutscene(NULL) { CreateUI(); m_cutscene = new BlockAnimation(renderer); }
TimelineUI::TimelineUI(IEditor* editor) { callback = editor; time = 0.0f; isPlaying = false; timer = new Timer; CreateUI(); timeSlider->step(0.01f); }
Player::Player(int pos, QString piece, QWidget *parent): QWidget(parent) { // srand(time(NULL)); this->pos = pos; this->piece = piece; money = 1200; lostTurn = 0; CreateUI(); }
void InterfacePane::CreateLayout() { m_main_layout = new QVBoxLayout; // Create layout here CreateUI(); CreateInGame(); m_main_layout->setContentsMargins(0, 0, 0, 0); m_main_layout->addStretch(1); setLayout(m_main_layout); }
void CCustomDetector::TurnDetectorInternal(bool b) { m_bWorking = b; if(b && m_ui==NULL) { CreateUI (); }else { //. xr_delete (m_ui); } UpdateNightVisionMode (b); }
TexGroupUI::TexGroupUI(TextureGroupHandler *tgh, TextureHandler *th) : texGroupHandler(tgh), textureHandler(th) { CreateUI (); for (map<string, TextureHandler::TexRef>::iterator ti=th->textures.begin();ti != th->textures.end(); ++ti) texBrowser->AddTexture (ti->second.texture.Get()); texBrowser->UpdatePositions(); current=0; UpdateGroupList(); window->exec (); }
void MasterControl::Start() { new InputMaster(context_, this); cache_ = GetSubsystem<ResourceCache>(); graphics_ = GetSubsystem<Graphics>(); renderer_ = GetSubsystem<Renderer>(); // Get default style defaultStyle_ = cache_->GetResource<XMLFile>("UI/DefaultStyle.xml"); SetWindowTitleAndIcon(); //Create console and debug HUD. CreateConsoleAndDebugHud(); //Create the scene content CreateScene(); //Create the UI content CreateUI(); //Hook up to the frame update and render post-update events }
MainWidget::MainWidget(QWidget *parent):ZKbMainWidget(ZHeader::MAINDISPLAY_HEADER,parent,0,0),nconnect(false) { cfg = new SETUP_SET_Manager(QString("setting.ini")); cfg->getSettingInfo(QString("Main"), QString("lang_src"), lang_src, "en"); cfg->getSettingInfo(QString("Main"), QString("lang_dst"), lang_dst, "ru"); cfg->getSettingInfo(QString("Main"), QString("GPRS_Profile"), GPRS_Profile, "0"); GPRS_Profile_Old = GPRS_Profile; //lang_src = "en"; //lang_dst = "ru"; lang = 0; memset(dot_array, 0x00, 1024); timer = new QTimer( this ); connect(timer, SIGNAL(timeout()), SLOT(timerEvent())); CreateUI(); }
int Trackobot::Run() { if( IsAlreadyRunning() ) return 1; LOG( "Launch v%s on %s", VERSION, qt2cstr( QDate::currentDate().toString( Qt::ISODate ) ) ); SetupUpdater(); CreateUI(); Initialize(); SetupLogging(); int exitCode = mApp.exec(); // Tear down LOG( "Shutdown" ); return exitCode; }
//--------------------------------------------------------------------------------------------------------------------------------------------------- void TerminalTWT::Start() { gLog = new Log(context_); gLog->SetLevel(Urho3D::LOG_INFO); gLog->Open("launcher.log"); gGraphics = GetSubsystem<Graphics>(); CreateUI(); MakeWindow(StateWindow::Start); SubscribeToEvents(); gContext = context_; CreateListFiles(); thread.Run(); thread.SetPriority(2); }
/* FUNCTION: WinMain DATE: 12/2/2015 REVISIONS: v2 - creates a random filename for this session DESIGNER: Dylan PROGRAMMER: Dylan INTERFACE: int CALLBACK WinMain(HINSTANCE hInst, HINSTANCE prevInstance, LPSTR lpCmdline, int nCmdShow) RETURNS: the exit message code NOTES: Main entry point for the program. */ int CALLBACK WinMain(HINSTANCE hInst, HINSTANCE prevInstance, LPSTR lpCmdline, int nCmdShow) { MSG Msg; // a random file name for this session srand((unsigned)time(NULL)); sprintf_s(FileName, "%d", rand()); strncat_s(FileName, ".txt.", 4); CreateUI(hInst); ShowWindow (hMain, nCmdShow); UpdateWindow (hMain); while (GetMessage (&Msg, NULL, 0, 0)) { TranslateMessage (&Msg); DispatchMessage (&Msg); } return Msg.wParam; }
MappingUI::MappingUI (IEditor *callback) : callback(callback) { CreateUI (); view->editor=callback; }
BackupViewerUI::BackupViewerUI(IEditor *cb) { callback = cb; CreateUI(); }
ToolBoxView::ToolBoxView(QWidget* parent) : QWidget(parent) , m_Device(nullptr) { CreateUI(); }
OSStatus AUCarbonViewBase::CreateCarbonView(AudioUnit inAudioUnit, WindowRef inWindow, ControlRef inParentControl, const Float32Point &inLocation, const Float32Point &inSize, ControlRef &outParentControl) { #if !__LP64__ mEditAudioUnit = inAudioUnit; mCarbonWindow = inWindow; WindowAttributes attributes; verify_noerr(GetWindowAttributes(mCarbonWindow, &attributes)); mCompositWindow = (attributes & kWindowCompositingAttribute) != 0; Rect area; area.left = short(inLocation.x); area.top = short(inLocation.y); area.right = short(area.left + inSize.x); area.bottom = short(area.top + inSize.y); OSStatus err = ::CreateUserPaneControl(inWindow, &area, kControlSupportsEmbedding, &mCarbonPane); // subclass can resize mCarbonPane to taste verify_noerr(err); if (err) return err; outParentControl = mCarbonPane; // register for mouse-down in our pane -- we want to clear focus EventTypeSpec paneEvents[] = { { kEventClassControl, kEventControlClick } }; WantEventTypes(GetControlEventTarget(mCarbonPane), GetEventTypeCount(paneEvents), paneEvents); if (IsCompositWindow()) { verify_noerr(::HIViewAddSubview(inParentControl, mCarbonPane)); mXOffset = 0; mYOffset = 0; } else { verify_noerr(::EmbedControl(mCarbonPane, inParentControl)); mXOffset = inLocation.x; mYOffset = inLocation.y; } mBottomRight.h = mBottomRight.v = 0; SizeControl(mCarbonPane, 0, 0); if (err = CreateUI(mXOffset, mYOffset)) return err; // we should only resize the control if a subclass has embedded // controls in this AND this is done with the EmbedControl call below // if mBottomRight is STILL equal to zero, then that wasn't done // so don't size the control Rect paneBounds; GetControlBounds(mCarbonPane, &paneBounds); // only resize mCarbonPane if it has not already been resized during CreateUI if ((paneBounds.top == paneBounds.bottom) && (paneBounds.left == paneBounds.right)) { if (mBottomRight.h != 0 && mBottomRight.v != 0) SizeControl(mCarbonPane, (short) (mBottomRight.h - mXOffset), (short) (mBottomRight.v - mYOffset)); } if (IsCompositWindow()) { // prepare for handling scroll-events EventTypeSpec scrollEvents[] = { { kEventClassScrollable, kEventScrollableGetInfo }, { kEventClassScrollable, kEventScrollableScrollTo } }; WantEventTypes(GetControlEventTarget(mCarbonPane), GetEventTypeCount(scrollEvents), scrollEvents); mCurrentScrollPoint.x = mCurrentScrollPoint.y = 0.0f; } return err; #else return noErr; #endif }
ImageScreenWithButtons::ImageScreenWithButtons() : Screen() { CreateUI(); }
void CNodePropertyUI::UpdatePropertiesFromTarget() { CreateUI(); }
// // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) // // PURPOSE: Processes messages for the main window. // // WM_COMMAND - process the application menu // WM_PAINT - Paint the main window // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc,hMemDC; TCHAR szHello[MAX_LOADSTRING]; LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING); switch (message) { case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); break; case IDM_EXIT: DestroyWindow(hWnd); break; case IDM_UP: SendMessage(hWnd,WM_KEYDOWN,(WPARAM)VK_UP,0); break; case IDM_LEFT: SendMessage(hWnd,WM_KEYDOWN,(WPARAM)VK_LEFT,0); break; case IDM_RIGHT: SendMessage(hWnd,WM_KEYDOWN,(WPARAM)VK_RIGHT,0); break; case IDM_DOWN: SendMessage(hWnd,WM_KEYDOWN,(WPARAM)VK_DOWN,0); break; case IDM_START_PAUSE: SendMessage(hWnd,WM_KEYDOWN,(WPARAM)VK_SPACE,0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_CREATE: m = 20; n = 15; for(i = 0; i < n_body; i++) { Position[i].x = m-i; Position[i].y = n; Matrix[Position[i].x][Position[i].y] = 1; } CreateFood(); CreateUI(hWnd); SetTimer(hWnd,100,speed,NULL); break; case WM_KEYDOWN: switch(wParam) { case VK_UP: //KillTimer(hWnd,100); if(direction != 2 && n>0 && CheckOver(hWnd,m,n-1)) { for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 0; } n--; CheckFood(); for(i = n_body-1; i > 0; i--) { Position[i] = Position[i-1]; } Position[0].y = n; for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 1; } CreateFood(); direction = 0; DrawUI(hWnd); } else MessageBeep(0); // SetTimer(hWnd,100,500,NULL); break; case VK_LEFT: // KillTimer(hWnd,100); if(direction != 1 && m>0 && CheckOver(hWnd,m-1,n)) { for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 0; } m--; CheckFood(); for(i = n_body-1; i > 0; i--) { Position[i] = Position[i-1]; } Position[0].x = m; for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 1; } CreateFood(); direction = 3; DrawUI(hWnd); } else MessageBeep(0); // SetTimer(hWnd,100,500,NULL); break; case VK_RIGHT: //KillTimer(hWnd,100); if(direction != 3 && m<39 && CheckOver(hWnd,m+1,n)) { for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 0; } m++; CheckFood(); for(i = n_body-1; i > 0; i--) { Position[i] = Position[i-1]; } Position[0].x = m; for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 1; } CreateFood(); direction = 1; DrawUI(hWnd); } else MessageBeep(0); // SetTimer(hWnd,100,500,NULL); break; case VK_SPACE: if(start_or_pause) { KillTimer(hWnd,100); start_or_pause = false; }else { SetTimer(hWnd,100,speed,NULL); start_or_pause = true; } break; case VK_DOWN: // KillTimer(hWnd,100); if(direction != 0 && n<31 && CheckOver(hWnd,m,n+1) ) { for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 0; } n++; CheckFood(); for(i = n_body-1; i > 0; i--) { Position[i] = Position[i-1]; } Position[0].y = n; for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 1; } CreateFood(); direction = 2; DrawUI(hWnd); } else MessageBeep(0); // SetTimer(hWnd,100,500,NULL); break; } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: Add any drawing code here... //GetClientRect(hWnd, &rt); hbr = (HBRUSH)GetStockObject(BLACK_BRUSH); hBmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP1)); hMemDC = CreateCompatibleDC(hdc); hBmpOld = (HBITMAP)SelectObject(hMemDC,hBmp); //Matrix[10][10] = 1; for(i = 0; i < 40; i++) for(j =0; j <32; j++) { rt.left = i * 16; rt.top = 24 + j *16; switch(Matrix[i][j]) { case 0: { rt.right = rt.left + 16; rt.bottom = rt.top + 16 ; FillRect(hdc,&rt,hbr); } break; case 1: { hBmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP1)); hMemDC = CreateCompatibleDC(hdc); hBmpOld = (HBITMAP)SelectObject(hMemDC,hBmp); BitBlt(hdc,rt.left,rt.top,16,16,hMemDC,0,0,SRCCOPY); SelectObject(hMemDC, hBmpOld); DeleteObject(hBmp); DeleteObject(hMemDC); } break; case 2: { hBmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP2)); hMemDC = CreateCompatibleDC(hdc); hBmpOld = (HBITMAP)SelectObject(hMemDC,hBmp); BitBlt(hdc,rt.left,rt.top,16,16,hMemDC,0,0,SRCCOPY); SelectObject(hMemDC, hBmpOld); DeleteObject(hBmp); DeleteObject(hMemDC); } break; } } SelectObject(hMemDC, hBmpOld); DeleteObject(hBmp); DeleteObject(hMemDC); EndPaint(hWnd, &ps); break; case WM_TIMER: //KillTimer(hWnd,100); switch(direction) { case 0://UP for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 0; } if(n>0) { n--; } else { //MessageBox(NULL,"Game Over!",NULL,NULL); KillTimer(hWnd,100); gameover = false; } CheckFood(); for(i = n_body-1; i > 0; i--) { Position[i] = Position[i-1]; } Position[0].y = n; for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 1; } CreateFood(); DrawUI(hWnd); break; case 1://RIGHT for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 0; } if(m<39) m++; else { //MessageBox(NULL,"Game Over!",NULL,NULL); KillTimer(hWnd,100); gameover = false; } CheckFood(); for(i = n_body-1; i > 0; i--) { Position[i] = Position[i-1]; } Position[0].x = m; for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 1; } CreateFood(); DrawUI(hWnd); break; case 2://DOWN for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 0; } if(n<31) n++; else { // MessageBox(NULL,"Game Over!",NULL,NULL); KillTimer(hWnd,100); gameover = false ; } CheckFood(); for(i = n_body-1; i > 0; i--) { Position[i] = Position[i-1]; } Position[0].y = n; for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 1; } CreateFood(); DrawUI(hWnd); break; case 3://LEFT for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 0; } if(m>0) m--; else { //MessageBox(NULL,"Game Over!",NULL,NULL); KillTimer(hWnd,100); gameover = false; } CheckFood(); for(i = n_body-1; i > 0; i--) { Position[i] = Position[i-1]; } Position[0].x = m; for(i = 0; i < n_body; i++) { Matrix[Position[i].x][Position[i].y] = 1; } CreateFood(); DrawUI(hWnd); break; } //SetTimer(hWnd,100,500,NULL); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; }
IK_UI::IK_UI(IEditor *callback) : callback(callback) { multipleTypes = 0; CreateUI (); }