void CTracksSerializerDlg::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); if (m_TrackList.m_hWnd) PositionControls(cx, cy); }
BOOL CHeadNotes::OnInitDialog() { wxDialog::OnInitDialog(); CenterWindow(); RECT r; GetClientRect(&r); PositionControls(r.right,r.bottom); m_editText.SetFocus(); m_editText.SetSel(0,0); return FALSE; }
void CScrollBar::Init(tint32 iID, EType Type, IWindow* pWnd, IResourceManager* pResMan, tint32 piIDs[BitmapCount], IScrollPane* pScrollPane, const SScrollPos& ScrollPos) { CControl::Init(iID); mpScrollPane = pScrollPane; mType = Type; mScrollPos = ScrollPos; // Lasse, this very important part got deleted!!!! - added again 2008-05-09 // Prepare to catch update-signal from scroll-pane if (mpScrollPane) mpScrollPane->AddListener(this); // .. Lasse // Create resources for first 2 bitmaps, and get the sizes. Also create controls and add them tint iBitmap; for (iBitmap = 0; iBitmap < 2; iBitmap++) { mppBitmapRes[iBitmap] = pResMan->GetBitmap(pWnd, piIDs[iBitmap], 2, 1); mppBitmapRes[iBitmap]->GetRealSize(mpBitmapSizes[iBitmap]); IButton* pButton = IButton::Create(); pButton->Init(-1, mppBitmapRes[iBitmap]); pButton->AddListener(dynamic_cast<IEventReceiver*>(this)); AddControl(pButton, SPos(0, 0)); } // Create resources for last 3 bitmaps, and get the sizes for (iBitmap = 2; iBitmap < BitmapCount; iBitmap++) { mppBitmapRes[iBitmap] = pResMan->GetBitmap(pWnd, piIDs[iBitmap], 1, 1); mppBitmapRes[iBitmap]->GetRealSize(mpBitmapSizes[iBitmap]); } SetSize((SSize)(mScrollPos.VisibleRect), false); switch(mType) { case TypeHorizontal: { // Left mSize.iCY = mpBitmapSizes[BitmapLeftTop].iCY; } break; case TypeVertical: { // Up mSize.iCX = mpBitmapSizes[BitmapLeftTop].iCX; } break; } PositionControls(); dynamic_cast<CScrollPane*>(mpScrollPane)->SetScrollBar(dynamic_cast<CScrollBar*>(this)); }
void CHeadNotes::OnSize(UINT nType, int cx, int cy) { wxDialog::OnSize(nType, cx, cy); if (nType==SIZE_RESTORED || nType==SIZE_MAXIMIZED) { if (m_editText.m_hWnd) { PositionControls(cx,cy); } } }
void MPCStatusBar::RemovePane(int nPaneID) { SetRedraw(FALSE); CWnd * pwnd = NULL; int i; for( i = 0; i < m_aPans.GetSize(); i++ ) { if( m_aPans[i]->m_nPaneID == nPaneID ) { if( m_aPans[i]->m_bAutodelete ) pwnd = m_aPans[i]->m_hWnd; delete m_aPans[i]; m_aPans.RemoveAt(i); break; } } if( pwnd ) { pwnd->DestroyWindow(); delete pwnd; } CArray<MPCStatusBarPane,MPCStatusBarPane> arPanes; MPCStatusBarPane statusPane; i = 0; while( GetStatusPane(i,statusPane) ) { if( statusPane.nID != (UINT)nPaneID ) arPanes.Add( statusPane ); i++; } // Now remove the indicator UINT * pIndicators = new UINT[arPanes.GetSize()]; for(i=0;i<arPanes.GetSize();i++) pIndicators[i]=arPanes[i].nID; SetIndicators(pIndicators,arPanes.GetSize()); // Replace infos of indicators .. for(i = 0; i < arPanes.GetSize(); i++ ) { SetPaneInfo(i,arPanes[i].nID,arPanes[i].nStyle,arPanes[i].cxText); SetPaneText(i,arPanes[i].strText); } delete pIndicators; SetRedraw(TRUE); PositionControls(); Invalidate(TRUE); }
int CButtonDialog::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (m_pHelpIDs != NULL) { for (int i=0;i<m_strArray.GetSize();i++) m_pHelpIDs[i*2] = i+m_nBaseID; } if (CCSDialog::OnCreate(lpCreateStruct) == -1) return -1; SetWindowText(m_strCaption); m_pButtons = new CButton[m_strArray.GetSize()]; CRect rect(0, 0, 10, 10); if (!m_staticIcon.Create(NULL, SS_ICON | WS_GROUP | WS_CHILD | WS_VISIBLE, rect, this)) { return -1; } m_staticIcon.SetIcon(::LoadIcon(NULL, GetIconID(m_wStyle))); if (!m_staticText.Create(m_strText, SS_LEFT | SS_NOPREFIX | WS_GROUP | WS_CHILD | WS_VISIBLE, rect, this)) { return -1; } m_staticText.SetFont(&m_font); for (int i=0;i<m_strArray.GetSize();i++) { if (!m_pButtons[i].Create(m_strArray[i], WS_TABSTOP | WS_CHILD | WS_VISIBLE | ((i == 0) ? WS_GROUP : 0) | ((i == m_nDefButton) ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON), rect, this, i+m_nBaseID)) { return -1; } m_pButtons[i].SetFont(&m_font); } PositionControls(); return 0; }
BOOL CTracksSerializerDlg::OnInitDialog() { CDialog::OnInitDialog(); PrgAPI* pAPI = PRGAPI(); int titleResID = m_bImport ? IDS_IMPORTVIRTUALTRACKS : IDS_EXPORTVIRTUALTRACKS; int descResID = m_bImport ? IDS_IMPORTVIRTUALTRACKSINFO : IDS_EXPORTVIRTUALTRACKSINFO; int btnResID = m_bImport ? IDS_IMPORT : IDS_EXPORT; SetWindowText(pAPI->GetString(titleResID)); m_description.SetWindowText(pAPI->GetString(descResID)); GetDlgItem(IDOK)->SetWindowText(pAPI->GetString(btnResID)); pAPI->SetGlobalButtonStyle(m_btnOK); pAPI->SetGlobalButtonStyle(m_btnCancel); m_TrackList.SetExtendedStyle(LVS_EX_BORDERSELECT | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES | LVS_EX_GRIDLINES); m_TrackList.SetItemCount(m_ItemsChecked.size()); m_TrackList.InsertColumn(0, pAPI->GetString(IDS_LOCATION), LVCFMT_LEFT, 200); m_TrackList.InsertColumn(1, pAPI->GetString(IDS_TITLE), LVCFMT_LEFT, 100); m_TrackList.InsertColumn(2, pAPI->GetString(IDS_ARTIST), LVCFMT_LEFT, 100); m_TrackList.InsertColumn(3, pAPI->GetString(IDS_ALBUM), LVCFMT_LEFT, 100); m_TrackList.InsertColumn(4, pAPI->GetString(IDS_DURATION), LVCFMT_LEFT, 50); m_TrackList.InsertColumn(5, pAPI->GetString(IDS_GENRE), LVCFMT_LEFT, 100); SetIcon(m_hIcon, FALSE); m_description.SetColor(CLabelEx::COL_Bk, RGB(200,210,210)); m_description.SetColor(CLabelEx::COL_Text, RGB(0,0,150)); m_description.SetBorderType(CLabelEx::B_BottomLine); //m_description.SetWindowText(PRGAPI()->GetString(IDS_IMPORTLINKS_INFO1)); //m_description.SetTextDrawOptions(CLabelEx::DO_Multiline); m_description.SetMargins(15,4); CRect rc; GetClientRect(&rc); PositionControls(rc.Width(), rc.Height()); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL MPCStatusBar::AddControl(CWnd * pWnd, int paneID, BOOL bAutodeleteControl) { MPCStatusBarPaneControlInfo * pPanInfo = GetPanControl(paneID); if( pPanInfo ) return FALSE; int idx = CommandToIndex( paneID ) ; if( idx == -1 ) return FALSE; MPCStatusBarPaneControlInfo * pPan = new MPCStatusBarPaneControlInfo; pPan->m_nPaneID = paneID; pPan->m_hWnd = pWnd; pPan->m_bAutodelete = bAutodeleteControl; m_aPans.Add(pPan); PositionControls(); Invalidate(TRUE); return TRUE; }
void CScrollBar::SetSize(const SSize& Size, tbool bRedraw) { CPane::SetSize(Size, bRedraw); PositionControls(); }
void CScrollBar::SetSize(const SSize& Size) { CPane::SetSize(Size, false); PositionControls(); }
void CTeenSpiritDlg::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); if (m_toolBar.m_hWnd!=NULL) PositionControls(cx, cy); }
void CTeenSpiritDlg::ApplySkin(ISkin& _skin) { CRect rc; GetClientRect(&rc); PositionControls(rc.Width(), rc.Height()); }
int ControlPanel::handleEvent (mxEvent *event) { MDLCACHE_CRITICAL_SECTION_( g_pMDLCache ); int iret = 0; if ( HandleToolEvent( event ) ) { return iret; } switch ( event->event ) { case mxEvent::Size: { PositionControls( event->width, event->height ); iret = 1; } break; case mxEvent::Action: { iret = 1; switch (event->action) { case IDC_TOOLSDRIVEMOUTH: { g_viewerSettings.faceposerToolsDriveMouth = ((mxCheckBox *)event->widget)->isChecked(); } break; case IDC_TAB: { g_viewerSettings.showTexture = (tab->getSelectedIndex() == 3); } break; case IDC_RENDERMODE: { int index = cRenderMode->getSelectedIndex(); if (index >= 0) { setRenderMode (index); } } break; case IDC_GROUND: setShowGround (((mxCheckBox *) event->widget)->isChecked()); break; case IDC_MOVEMENT: setShowMovement (((mxCheckBox *) event->widget)->isChecked()); break; case IDC_BACKGROUND: setShowBackground (((mxCheckBox *) event->widget)->isChecked()); break; case IDC_HITBOXES: g_viewerSettings.showHitBoxes = ((mxCheckBox *) event->widget)->isChecked(); break; case IDC_PHYSICSMODEL: g_viewerSettings.showPhysicsModel = ((mxCheckBox *) event->widget)->isChecked(); break; case IDC_BONES: g_viewerSettings.showBones = ((mxCheckBox *) event->widget)->isChecked(); break; case IDC_ATTACHMENTS: g_viewerSettings.showAttachments = ((mxCheckBox *) event->widget)->isChecked(); break; case IDC_SEQUENCE: { int index = cSequence->getSelectedIndex(); if (index >= 0) { setSequence ( index ); } } break; case IDC_SPEEDSCALE: { g_viewerSettings.speedScale = ((mxSlider *) event->widget)->getValue(); lSpeedScale->setLabel( va( "Speed scale %.2f", g_viewerSettings.speedScale ) ); } break; case IDC_PRIMARYBLEND: { setBlend( 0, ((mxSlider *) event->widget)->getValue() ); } break; case IDC_SECONDARYBLEND: { setBlend( 1, ((mxSlider *) event->widget)->getValue() ); } break; case IDC_BODYPART: { int index = cBodypart->getSelectedIndex(); if (index >= 0) { setBodypart (index); } } break; case IDC_SUBMODEL: { int index = cSubmodel->getSelectedIndex(); if (index >= 0) { setSubmodel (index); } } break; case IDC_CONTROLLER: { int index = cController->getSelectedIndex(); if (index >= 0) setBoneController (index); } break; case IDC_CONTROLLERVALUE: { int index = cController->getSelectedIndex(); if (index >= 0) setBoneControllerValue (index, slController->getValue()); } break; case IDC_SKINS: { int index = cSkin->getSelectedIndex(); if (index >= 0) { models->GetActiveStudioModel()->SetSkin (index); g_viewerSettings.skin = index; g_pMatSysWindow->redraw(); } } break; default: iret = 0; break; } } } return iret; }
void MPCStatusBar::OnSize(UINT nType, int cx, int cy) { CStatusBar::OnSize(nType, cx, cy); PositionControls(); }
BOOL MPCStatusBar::AddIndicator( int position, UINT paneID ) { CArray<MPCStatusBarPane,MPCStatusBarPane> arPanes; MPCStatusBarPane statusPane; int i; i = 0; while( GetStatusPane(i,statusPane) ) { arPanes.Add( statusPane ); i++; } if( position < 0 ) position = 0; if( position > arPanes.GetSize() ) position = arPanes.GetSize()-1; for(i = 0; i < arPanes.GetSize(); i ++ ) { if( paneID == arPanes[i].nID ) { TRACE(_T("XFXStatusBar::AddIndicator(): Pane ID already exists \n")); return FALSE; } } MPCStatusBarPane new_statusPane; new_statusPane.nID = paneID; if( arPanes.GetSize() ) arPanes.InsertAt(position,new_statusPane); else arPanes.Add(new_statusPane); UINT * pIndicators = new UINT[arPanes.GetSize()]; for(i=0;i<arPanes.GetSize();i++) pIndicators[i]=arPanes[i].nID; SetRedraw(FALSE); SetIndicators(pIndicators,arPanes.GetSize()); // Replace infos of indicators .. for(i = 0; i < arPanes.GetSize(); i++ ) { if( arPanes[i].nID != paneID ) { SetPaneInfo(i,arPanes[i].nID,arPanes[i].nStyle,arPanes[i].cxText); SetPaneText(i,arPanes[i].strText); } else { SetPaneWidth(i,50); SetPaneText(i,arPanes[i].strText); } } delete pIndicators; SetRedraw(TRUE); PositionControls(); Invalidate(TRUE); return TRUE; }