Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / wxScrolledWindow & wxStaticBitmap

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. wxScrolledWindow & wxStaticBitmap
#4032
Posted by: KaReL 2004-05-05 13:19:06

Frame::Frame(const wxString& title)
       : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(640,480))
{
  wxBoxSizer * topSizer = new wxBoxSizer(wxHORIZONTAL);
  topSizer->Add(new Canvas(this), 1, wxEXPAND);

  SetSizer(topSizer);
  topSizer->FitInside(this);
}

Canvas::Canvas( wxWindow * parent ) : 
  wxScrolledWindow( parent, wxID_ANY )
{
  if ( wxFileExists( wxT("dpd_test.tif") ) )
  {
    ::wxInitAllImageHandlers();
    POD_Image.LoadFile( wxT("dpd_test.tif") );
  }

  if ( POD_Image.Ok() )
  {
    wxBoxSizer * topSizer = new wxBoxSizer(wxBOTH);
    topSizer->Add(
    new wxStaticBitmap( this, wxID_ANY, wxBitmap(POD_Image) ),
    1,
    wxEXPAND );

    SetSizer( topSizer );
    topSizer->SetSizeHints(this);
  }
}
Now my image is (GetVirtualSize() -> w1728, h2273)... And my screen is w640,h480... Now the "viewsize" is ofcourse not equal to the real size. But how can I show scrollbars? Aren't they supposed to show up automagically?
------------------------
Website: www.KaReLs0ft.be
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2024-12-11  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0