void wxListSelection::SetItemText(const wxString &field, const wxString &text) { // Make sure the field exists. Impl::StringHash::iterator it = mpImpl->mFields.find(field); if(mpImpl->mFields.end() != it) { it->second = text; // Calculate height even for empty strings. if(true == text.IsEmpty()) { it->second = swAy; } SetMinimumSize(); if(true == text.IsEmpty()) { it->second = swEmpty; } wxSizer *sizer = mParent->GetSizer(); if(NULL != sizer) { sizer->Layout(); } Refresh(); } }
void wxListSelection::OnSkin() { mpImpl->mMainFont = SKIN.Font(mpImpl->mMainFontName); mpImpl->mSubFont = SKIN.Font(mpImpl->mSubFontName); mpImpl->mBackground = SKIN.Element(shBackground); mpImpl->mHighlight = SKIN.Element(shListHighlight); mpImpl->mSelected = SKIN.Element(shListSelection); mpImpl->mHighlightAndSelected = SKIN.Element(shListHighlightAndSelection); mpImpl->mMainText = SKIN.Element(shListMainText); mpImpl->mMainTextShadow = SKIN.Element(shListMainTextShadow); mpImpl->mMainTextDisabled = SKIN.Element(shListMainTextDisabled); mpImpl->mSubText = SKIN.Element(shListSubText); mpImpl->mSubTextShadow = SKIN.Element(shListSubTextShadow); mpImpl->mTransparent = SKIN.Element(shTransparent); if(false == mpImpl->mIcon.empty()) { wxImage thisImage = IMAGE.GetImage(shIcons, mpImpl->mIcon); mpImpl->mBitmap = wxBitmap(thisImage); } if(true == mpImpl->mBitmap.Ok()) { mpImpl->mBitmap.SetMask(new wxMask(mpImpl->mBitmap, SKIN.Element(shIconTransparent))); } SetMinimumSize(); }
//////////////////////////////////////////////////////////////////// // Public functions // CReportEntityPicture::CReportEntityPicture() /* ============================================================ Function : CReportEntityPicture::CReportEntityPicture Description : Constructor. Access : Public Return : void Parameters : none Usage : ============================================================*/ { SetType( _T( "report_picture" ) ); CReportEntitySettings::GetRESInstance()->GetBorderSettings( this ); SetAttributeDialog( &m_dlg, IDD_REPORT_DIALOG_PICTURE_PROPERTIES ); m_image_type = -1; m_image_size = 0; m_image_bits = NULL; m_bitmap = NULL; SetMinimumSize( CSize( 0, 0 ) ); }
CGumpStatic::CGumpStatic(int hueId, int fontId, TEXT_ALIGN textAlign) : m_textAlign(textAlign), m_hueId(hueId), m_fontId(fontId) { SetMinimumSize( CSize( 1, 1 ) ); SetTitle("label"); SetType("label"); SetName("label"); AddPropertyPage( &m_page ); }
CGumpEntity::CGumpEntity() { SetMinimumSize( CSize( 1, 1 ) ); SetTitle( "control" ); SetType( "control" ); SetName( "control" ); SetAlpha(0); SetFlags(0); AddPropertyPage( &m_page ); }
CGumpStatic::CGumpStatic(CGumpStatic* pOther) : m_hueId(1), m_fontId(3), m_textAlign(ALIGN_LEFT), m_multiLine(false) { SetMinimumSize( CSize( 1, 1 ) ); SetTitle("label"); SetType("label"); SetName("label"); AddPropertyPage( &m_page ); if (pOther) Copy(pOther); }
//----------------------------------------------------------------------------- // // CFileManagerFrame methods // //----------------------------------------------------------------------------- CFileManagerFrame::CFileManagerFrame( vgui::Panel *parent ) : BaseClass( parent, "FileManagerFrame" ) { SetTitle( "#BxFileManagerFrame", true ); SetSizeable( true ); SetCloseButtonVisible( false ); SetMinimumSize( 200, 200 ); SetVisible( true ); SetSize( 800, 200 ); SetPos( 100, 100 ); m_pFileListManager = new CFileListManager( this ); Refresh(); SetScheme( vgui::scheme()->LoadSchemeFromFile( "Resource/BoxRocket.res", "BoxRocket" ) ); }
CDiagramButton::CDiagramButton() /* ============================================================ Function : CDiagramButton::CDiagramButton Description : constructor Return : void Parameters : none Usage : ============================================================*/ { SetMinimumSize( CSize(1,1) ); SetTitle( "Button" ); SetType( "button" ); SetName( "button" ); // SetPropertyDialog( &m_dlg, CButtonPropertyDlg::IDD ); }
CDiagramEdit::CDiagramEdit() /* ============================================================ Function : CDiagramEdit::CDiagramEdit Description : constructor Return : void Parameters : none Usage : ============================================================*/ { SetMinimumSize( CSize( 1, 1 ) ); SetTitle("Edit"); SetType("editbox"); SetName( "editbox" ); // SetPropertyDialog( &m_dlg, CEditPropertyDlg::IDD ); }
//////////////////////////////////////////////////////////////////// // Public functions // CReportEntityBox::CReportEntityBox() /* ============================================================ Function : CReportEntityBox::CReportEntityBox Description : Constructor. Access : Public Return : void Parameters : none Usage : ============================================================*/ { SetType( _T( "report_box" ) ); CReportEntitySettings::GetRESInstance()->GetBorderSettings( this ); CReportEntitySettings::GetRESInstance()->GetFillSettings( this ); SetAttributeDialog( &m_dlg, IDD_REPORT_DIALOG_BOX_PROPERTIES ); SetMinimumSize( CSize( 0, 0 ) ); }
CCode_Editor::CCode_Editor( CSheet_Base *parent, const char *pName, CSmartText::CodeEditMode_t mode ) : BaseClass( parent, pName ) { m_iMode = mode; Activate(); SetVisible( true ); SetPaintBackgroundEnabled(true); SetPaintEnabled(true); SetSizeable(true); SetMoveable(true); SetMinimumSize( 500, 400 ); SetDeleteSelfOnClose( true ); m_iLastAppliedCodeIndex = 0; m_pCodeWindow = new CSmartText( this, "codewindow", mode ); m_pCodeWindow->AddActionSignalTarget( this ); /* TextEntry *pT = new TextEntry( this, "codewindow" ); pT->SetMultiline( true ); pT->SetEditable( true ); pT->SetCatchEnterKey( true ); pT->SetVerticalScrollbar( true ); */ LoadControlSettings( "shadereditorui/vgui/code_editor_Window.res" ); UpdateButtonEnabled( true, true ); SetCloseButtonVisible(false); int w,t; surface()->GetScreenSize( w, t ); w *= 0.75f; t *= 0.75f; SetSize( max( w, 500 ), max( t, 400 ) ); //SetKeyBoardInputEnabled( false ); //SetMouseInputEnabled( true ); //SetTitle( "Editor", true ); SetTitle( "", false ); Panel *pButton = FindChildByName( "button_save" ); if ( pButton ) pButton->SetKeyBoardInputEnabled( false ); pButton = FindChildByName( "button_apply" ); if ( pButton ) pButton->SetKeyBoardInputEnabled( false ); pButton = FindChildByName( "button_cancel" ); if ( pButton ) pButton->SetKeyBoardInputEnabled( false ); DoModal(); int rx, ry, rsx, rsy; if ( pEditorRoot->GetCodeEditorBounds( rx, ry, rsx, rsy ) ) SetBounds( rx, ry, rsx, rsy ); else MoveToCenterOfScreen(); }
void dng_host::ValidateSizes () { // The maximum size limits the other two sizes. if (MaximumSize ()) { SetMinimumSize (Min_uint32 (MinimumSize (), MaximumSize ())); SetPreferredSize (Min_uint32 (PreferredSize (), MaximumSize ())); } // If we have a preferred size, it limits the minimum size. if (PreferredSize ()) { SetMinimumSize (Min_uint32 (MinimumSize (), PreferredSize ())); } // Else find default value for preferred size. else { // If preferred size is zero, then we want the maximim // size image. if (MaximumSize ()) { SetPreferredSize (MaximumSize ()); } } // If we don't have a minimum size, find default. if (!MinimumSize ()) { // A common size for embedded thumbnails is 120 by 160 pixels, // So allow 120 by 160 pixels to be used for thumbnails when the // preferred size is 256 pixel. if (PreferredSize () >= 160 && PreferredSize () <= 256) { SetMinimumSize (160); } // Many sensors are near a multiple of 1024 pixels in size, but after // the default crop, they are a just under. We can get an extra factor // of size reduction if we allow a slight undershoot in the final size // when computing large previews. else if (PreferredSize () >= 490 && PreferredSize () <= 512) { SetMinimumSize (490); } else if (PreferredSize () >= 980 && PreferredSize () <= 1024) { SetMinimumSize (980); } else if (PreferredSize () >= 1470 && PreferredSize () <= 1536) { SetMinimumSize (1470); } else if (PreferredSize () >= 1960 && PreferredSize () <= 2048) { SetMinimumSize (1960); } // Else minimum size is same as preferred size. else { SetMinimumSize (PreferredSize ()); } } }