Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

wxWindow * wxPropertyGrid::GenerateEditorButton ( const wxPoint &  pos,
const wxSize &  sz 
)

Shortcut for creating dialog-caller button. Used, for example, by wxFontProperty.

Remarks:
This should only be called by properties.

Definition at line 4970 of file propgrid.cpp.

References wxPG_PROP_READONLY.

{
#ifdef __WXMAC__
   // Decorations are chunky on Mac, and we can't make the button square, so
   // do things a bit differently on this platform.

   wxPoint p(pos.x+sz.x,
             pos.y+wxPG_BUTTON_SIZEDEC-wxPG_NAT_BUTTON_BORDER_Y);
   wxSize s(25, -1);

   wxButton* but = new wxButton();
   but->Create(this,wxPG_SUBID2,wxT("..."),p,s,wxWANTS_CHARS);

   // Now that we know the size, move to the correct position
   p.x = pos.x + sz.x - but->GetSize().x - 2;
   but->Move(p);

#else 
    wxSize s(sz.y-(wxPG_BUTTON_SIZEDEC*2)+(wxPG_NAT_BUTTON_BORDER_Y*2),
        sz.y-(wxPG_BUTTON_SIZEDEC*2)+(wxPG_NAT_BUTTON_BORDER_Y*2));

    // Reduce button width to lineheight
    if ( s.x > m_lineHeight )
        s.x = m_lineHeight;

    wxPoint p(pos.x+sz.x-s.x,
        pos.y+wxPG_BUTTON_SIZEDEC-wxPG_NAT_BUTTON_BORDER_Y);

    wxButton* but = new wxButton();
#ifdef __WXMSW__
    but->Hide();
#endif
    but->Create(this,wxPG_SUBID2,wxT("..."),p,s,wxWANTS_CHARS);

    but->SetFont( m_captionFont );
#endif

      if ( m_selected->HasFlag(wxPG_PROP_READONLY) )
            but->Disable();

    return but;
}

Generated by  Doxygen 1.6.0   Back to index