void wxStaticText::SetLabel(
  const wxString&                   rsLabel
)
{
    m_labelOrig = rsLabel;       // save original label

    // OS/2 does not support neither ellipsize nor markup in static text:
    DoSetLabel(rsLabel);
    DoSetLabel(GetEllipsizedLabelWithoutMarkup());

    //
    // Adjust the size of the window to fit to the label unless autoresizing is
    // disabled
    //
    if (!(GetWindowStyle() & wxST_NO_AUTORESIZE) &&
        !IsEllipsized())
    {
        wxCoord                     vX;
        wxCoord                     vY;
        wxCoord                     vWidth;
        wxCoord                     vHeight;

        GetPosition(&vX, &vY);
        GetSize(&vWidth, &vHeight);
        if (!(vX == -1 && vY == -1 && vWidth == -1 && vHeight == -1))
            DoSetSize(vX, vY, vWidth, vHeight, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
        else
            DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
    }
} // end of wxStaticText::SetLabel
Beispiel #2
0
void wxStaticText::SetLabel(
  const wxString&                   rsLabel
)
{
    wxString                        sLabel = ::wxPMTextToLabel(rsLabel);
    ::WinSetWindowText(GetHwnd(), (PSZ)sLabel.c_str());

    //
    // Adjust the size of the window to fit to the label unless autoresizing is
    // disabled
    //
    if (!(GetWindowStyle() & wxST_NO_AUTORESIZE))
    {
        wxCoord                     vX;
        wxCoord                     vY;
        wxCoord                     vWidth;
        wxCoord                     vHeight;

        GetPosition(&vX, &vY);
        GetSize(&vWidth, &vHeight);
        if (!(vX == -1 && vY == -1 && vWidth == -1 && vHeight == -1))
            DoSetSize(vX, vY, vWidth, vHeight, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
        else
            DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
    }
} // end of wxStaticText::SetLabel
Beispiel #3
0
void wxTopLevelWindowGTK::DoSetClientSize( int width, int height )
{
    wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );

    DoSetSize(-1, -1,
              width + m_miniEdge*2, height  + m_miniEdge*2 + m_miniTitle, 0);
}
Beispiel #4
0
void MorphanView::SetCanvasSize(int nwidth, int nheight)
{
    width = nwidth;
    height = nheight;
    DoSetSize(width, height);
    panel->Refresh();
}
Beispiel #5
0
bool wxStaticText::SetFont(const wxFont& font)
{
    bool ret = wxControl::SetFont(font);

    // adjust the size of the window to fit to the label unless autoresizing is
    // disabled
    if ( !HasFlag(wxST_NO_AUTORESIZE) )
    {
        InvalidateBestSize();
        DoSetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, wxDefaultCoord,
                  wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
    }

    return ret;
}
Beispiel #6
0
bool wxStaticText::SetFont(
  const wxFont&                     rFont
)
{
    bool                            bRet = wxControl::SetFont(rFont);

    //
    // Adjust the size of the window to fit to the label unless autoresizing is
    // disabled
    //
    if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
    {
        DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
    }
    return bRet;
} // end of wxStaticText::SetFont
Beispiel #7
0
void wxStaticText::SetLabel(const wxString& label)
{
#ifdef SS_ENDELLIPSIS
    long styleReal = ::GetWindowLong(GetHwnd(), GWL_STYLE);
    if ( HasFlag(wxST_ELLIPSIZE_END) &&
          wxGetOsVersion() == wxOS_WINDOWS_NT )
    {
        // adding SS_ENDELLIPSIS or SS_ENDELLIPSIS "disables" the correct
        // newline handling in static texts: the newlines in the labels are
        // shown as square. Thus we don't use it even on newer OS when
        // the static label contains a newline.
        if ( label.Contains(wxT('\n')) )
            styleReal &= ~SS_ENDELLIPSIS;
        else
            styleReal |= SS_ENDELLIPSIS;

        ::SetWindowLong(GetHwnd(), GWL_STYLE, styleReal);
    }
    else // style not supported natively
    {
        styleReal &= ~SS_ENDELLIPSIS;
        ::SetWindowLong(GetHwnd(), GWL_STYLE, styleReal);
    }
#endif // SS_ENDELLIPSIS

    // save the label in m_labelOrig with both the markup (if any) and
    // the mnemonics characters (if any)
    m_labelOrig = label;

#ifdef SS_ENDELLIPSIS
    if ( styleReal & SS_ENDELLIPSIS )
        DoSetLabel(GetLabel());
    else
#endif // SS_ENDELLIPSIS
        DoSetLabel(GetEllipsizedLabel());

    // adjust the size of the window to fit to the label unless autoresizing is
    // disabled
    if ( !HasFlag(wxST_NO_AUTORESIZE) &&
         !IsEllipsized() )  // if ellipsize is ON, then we don't want to get resized!
    {
        InvalidateBestSize();
        DoSetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, wxDefaultCoord,
                  wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
    }
}
Beispiel #8
0
void wxFrame::DoSetClientSize(int clientwidth, int clientheight)
{
    int currentclientwidth , currentclientheight ;
    int currentwidth , currentheight ;

    GetClientSize( &currentclientwidth , &currentclientheight ) ;
    if ( clientwidth == -1 )
        clientwidth = currentclientwidth ;
    if ( clientheight == -1 )
        clientheight = currentclientheight ;
    GetSize( &currentwidth , &currentheight ) ;

    // find the current client size

    // Find the difference between the entire window (title bar and all) and
    // the client area; add this to the new client size to move the window
    DoSetSize( -1 , -1 , currentwidth + clientwidth - currentclientwidth ,
        currentheight + clientheight - currentclientheight , wxSIZE_USE_EXISTING ) ;
}
Beispiel #9
0
void wxChoice::UpdateVisibleHeight()
{
    // be careful to not change the width here
    DoSetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, GetSize().y, wxSIZE_USE_EXISTING);
}
Beispiel #10
0
void MorphanView::SetZoom(float nzoom)
{
    zoom = nzoom;
    DoSetSize(width, height);
    panel->Refresh();
}