本文整理汇总了C++中DoGetBestSize函数的典型用法代码示例。如果您正苦于以下问题:C++ DoGetBestSize函数的具体用法?C++ DoGetBestSize怎么用?C++ DoGetBestSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DoGetBestSize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoGetBestSize
wxSize wxSheetCellStringRendererRefData::GetBestSize(wxSheet& sheet,
const wxSheetCellAttr& attr,
wxDC& dc,
const wxSheetCoords& coords)
{
return DoGetBestSize(sheet, attr, dc, GetString(sheet, coords));
}
示例2: SetMinSize
void wxRibbonBar::ShowPanels(bool show)
{
m_arePanelsShown = show;
SetMinSize(wxSize(GetSize().GetWidth(), DoGetBestSize().GetHeight()));
Realise();
GetParent()->Layout();
}
示例3: wxGetDisplay
void WXAppBar::UnSetDockedModeStep2()
{
Display *dd= (Display *) wxGetDisplay();
// Window X11 handle
GtkWidget *gtkWidget= (GtkWidget *) this->GetHandle();
Window w= GDK_WINDOW_XWINDOW (gtkWidget->window);
Refresh();
Update();
//
// Set window style back to normal again
//
Atom atomTmp= XInternAtom (dd, "_NET_WM_WINDOW_TYPE", False);
Atom atom_NET_WM_WINDOW_TYPE_NORMAL= XInternAtom (dd, "_NET_WM_WINDOW_TYPE_NORMAL", False);
unsigned long propInfo= atom_NET_WM_WINDOW_TYPE_NORMAL;
XChangeProperty (dd, w, atomTmp, XA_ATOM, 32, PropModeReplace, (unsigned char *) &propInfo, 1);
XSync(dd, False);
// The code above disables the sticky property, so we enable it again
SetSticky(true);
// Restore decorations when needed
SetBorderDecorations(m_dialogHadBorderDecorations);
// Restore original size
wxSize proposedSize= DoGetBestSize();
//SetSize (0, 0, proposedSize.GetWidth(), proposedSize.GetHeight());
SetSize (proposedSize.GetWidth(), proposedSize.GetHeight());
}
示例4: OldGetMinSize
wxSize wxButton::GetMinSize() const
{
if( wxMotifLargeButtons() )
return OldGetMinSize();
return DoGetBestSize();
}
示例5: wxCHECK_RET
void wxSpinButton::OnSize( wxSizeEvent &WXUNUSED(event) )
{
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
m_width = DoGetBestSize().x;
gtk_widget_set_size_request( m_widget, m_width, m_height );
}
示例6: CalcLayout
void wxCustomButton::SetMargins(const wxSize &margin, bool fit)
{
m_labelMargin = margin;
m_bitmapMargin = margin;
CalcLayout(TRUE);
if (fit) SetSize(DoGetBestSize());
}
示例7: DoGetBestSize
wxSize wxGridCellStringRenderer::GetBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc,
int row, int col)
{
return DoGetBestSize(attr, dc, grid.GetCellValue(row, col));
}
示例8: WXUNUSED
void wxComboBox::DoSetSize(int x, int y,
int width, int WXUNUSED(height),
int sizeFlags)
{
// Necessary so it doesn't call wxChoice::SetSize
wxWindow::DoSetSize(x, y, width, DoGetBestSize().y, sizeFlags);
}
示例9: SetBackgroundColour
bool wxMenuButton::Create( wxWindow* parent, wxWindowID id,
const wxString &label,
const wxBitmap &bitmap,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& val,
const wxString& name)
{
m_style = style;
long flat = style & wxMENUBUT_FLAT;
wxControl::Create(parent,id,pos,size,wxNO_BORDER|wxCLIP_CHILDREN,val,name);
wxControl::SetLabel(label);
SetBackgroundColour(parent->GetBackgroundColour());
SetForegroundColour(parent->GetForegroundColour());
SetFont(parent->GetFont());
m_labelButton = new MenuLabelButton(this, id, label, bitmap, wxCUSTBUT_BUTTON|flat);
m_dropdownButton = new MenuDropButton(this, IDD_DROPDOWN_BUTTON, wxCUSTBUT_BUTTON|flat);
wxSize bestSize = DoGetBestSize();
SetSize( wxSize(size.x < 0 ? bestSize.x : size.x,
size.y < 0 ? bestSize.y : size.y) );
#if (wxMINOR_VERSION<8)
SetBestSize(GetSize());
#else
SetInitialSize(GetSize());
#endif
return TRUE;
}
示例10: DoGetBestSize
bool wxCustomButton::Create(wxWindow* parent, wxWindowID id,
const wxString& label, const wxBitmap &bitmap,
const wxPoint& pos, const wxSize& size,
long style, const wxValidator& val,
const wxString& name)
{
if (!wxControl::Create(parent,id,pos,size,wxNO_BORDER|wxCLIP_CHILDREN,val,name))
return FALSE;
wxControl::SetLabel(label);
wxControl::SetBackgroundColour(parent->GetBackgroundColour());
wxControl::SetForegroundColour(parent->GetForegroundColour());
wxControl::SetFont(parent->GetFont());
if (bitmap.Ok()) m_bmpLabel = bitmap;
if (!SetButtonStyle(style)) return FALSE;
wxSize bestSize = DoGetBestSize();
SetSize(wxSize(size.x<0 ? bestSize.x:size.x, size.y<0 ? bestSize.y:size.y));
#if (wxMINOR_VERSION<8)
SetBestSize(GetSize());
#else
SetInitialSize(GetSize());
#endif
CalcLayout(TRUE);
return TRUE;
}
示例11: DoGetBestSize
void WXAppBar::SetDockedModeStep1()
{
// TODO: manage different docking locations on windows
APPBARDATA abd;
// Set metrics (TOP location only)
wxSize proposedSize= DoGetBestSize();
m_X= 0;
m_Y= 0;
m_Width= GetSystemMetrics(SM_CXSCREEN);
m_Height= proposedSize.GetHeight();
// Register appbar
abd.cbSize= sizeof(APPBARDATA);
abd.hWnd= (HWND) GetHandle();
abd.uCallbackMessage= 12345; //WX_APPBAR_CALLBACK; // TODO: respond to these callback messages
SHAppBarMessage (ABM_NEW, &abd);
// Set size
abd.uEdge= ABE_TOP;
abd.rc.left = m_X;
abd.rc.top = m_Y;
abd.rc.right = m_X + m_Width;
abd.rc.bottom = m_Y + m_Height;
SHAppBarMessage(ABM_QUERYPOS,&abd); // Correct size if needed
m_X= abd.rc.left;
m_Y= abd.rc.top;
m_Width= abd.rc.right - m_X;
// Re-calculate bottom corner
abd.rc.bottom = m_Y + m_Height;
SHAppBarMessage(ABM_SETPOS, &abd);
}
示例12: PrepareBackground
/** Prepares the backgroundimage, to optimze speed */
void wxLEDPanel::PrepareBackground()
{
wxSize s=DoGetBestSize();
wxBitmap bmpBG(s.GetWidth(),s.GetHeight());
m_mdc_background.SelectObject(bmpBG);
// clear the background
m_mdc_background.SetBackground(this->GetBackgroundColour());
m_mdc_background.Clear();
if(m_invert || m_show_inactivs)
DrawField(m_mdc_background, true);
}
示例13: DoGetBestSize
bool wxSpinButton::Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
m_needParent = true;
wxSize new_size = size,
sizeBest = DoGetBestSize();
new_size.x = sizeBest.x; // override width always
if (new_size.y == -1)
new_size.y = sizeBest.y;
if (!PreCreation( parent, pos, new_size ) ||
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
{
wxFAIL_MSG( wxT("wxXX creation failed") );
return false;
}
m_oldPos = 0.0;
m_adjust = (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 100.0, 1.0, 5.0, 0.0);
m_widget = gtk_spin_button_new( m_adjust, 0, 0 );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget),
(int)(m_windowStyle & wxSP_WRAP) );
gtk_signal_connect( GTK_OBJECT (m_adjust),
"value_changed",
(GtkSignalFunc) gtk_spinbutt_callback,
(gpointer) this );
m_parent->DoAddChild( this );
PostCreation(new_size);
return true;
}
示例14: SetFieldsCount
bool wxStatusBarUniv::Create(wxWindow *parent,
wxWindowID id,
long style,
const wxString& name)
{
if ( !wxWindow::Create(parent, id,
wxDefaultPosition, wxDefaultSize,
style, name) )
{
return false;
}
SetFieldsCount(1);
CreateInputHandler(wxINP_HANDLER_STATUSBAR);
SetSize(DoGetBestSize());
return true;
}
示例15: switch
void wxRibbonBar::ShowPanels(wxRibbonDisplayMode mode)
{
switch ( mode )
{
case wxRIBBON_BAR_PINNED:
case wxRIBBON_BAR_EXPANDED:
m_arePanelsShown = true;
break;
case wxRIBBON_BAR_MINIMIZED:
m_arePanelsShown = false;
break;
}
SetMinSize(wxSize(GetSize().GetWidth(), DoGetBestSize().GetHeight()));
Realise();
GetParent()->Layout();
m_ribbon_state = mode;
}