|
Prev: Re[2]: Hybrid GUI/Console App
Next: Strange wxGTK behavior (was Re: wxDateTime (time_t) Save/Load)
From: Alejandro Mostovoi on 17 Apr 2008 14:08 <!-- DIV {margin:0px;}-->Hi!! I'm trying to use a wxScrolledWindow with a wxSimpleHtmlListBox inside, but the problem is that when I change the wxScrolledWindow 's size the HScrollBar set to disabled. when I change the size of the frame the wxScrolledWindow.GetClientSize(), the wxScrolledWindow.GetVirtualSize() and the wxSimpleHtmlListBox.GetSize() return the same values, hence there is no need for a scrollbar. But the wxSimpleHtmlListBox.GetSize() should be bigger because of it´s contents, and this should enable the scrollbar (because I set wxScrolledWindow´s virtualsize to this dimension). Could you help me to fix it?? In the constructor I have: wxFrame *pframe = this; pframe->Create(NULL,wxID_ANY,"My Frame"); pframe->SetSizer(psizerframe); pPanel_ = new wxPanel(pframe, wxID_PANEL1); psizerframe->Add(pPanel_, 1, wxEXPAND); pPanel_->SetSizer(psizerpanel); pScrollWindow_ = new wxScrolledWindow(pPanel_, wxID_SCROLLWINDOW); psizerpanel->Add(pScrollWindow_,1,wxEXPAND); pScrollWindow_->SetSizer(psizerscroll); pHtmlList_ = new wxSimpleHtmlListBox(); const wxString choices[] = {"Elemento_1", "Elemento_2_Nombre_corto.", "Elemento_3_Nombre_largo_aldfaldsfladfladkflasdfkalsdfkadlfkalkjfads."}; pHtmlList_->Create(pScrollWindow_, wxID_HTMLSIMPLELIST, wxDefaultPosition, wxDefaultSize, 3, choices); psizerscroll->Add(pHtmlList_,1,wxEXPAND); In the OnResize() I'm doing: m_ScrollWindow->SetVirtualSize(m_HtmlList->GetSize()); Regards. Alejandro Los referentes más importantes en compra/ venta de autos se juntaron: Demotores y Yahoo! Ahora comprar o vender tu auto es más fácil. Vistá ar.autos.yahoo.com/
From: Alejandro Mostovoi on 17 Apr 2008 16:21 Hi for everyone!! I managed to get the scrollbar enable, but I can't understand why. What I did is to set the default size for the wxSimpleHtmlListBox. pHtmlList_->Create(pScrollWindow_, wxID_HTMLSIMPLELIST, wxDefaultPosition, wxSize(500, 50), 3, choices); I would be grateful if someone explain me this. Regards. Alejandro ----- Mensaje original ---- De: Alejandro Mostovoi <a.mostovoi(a)yahoo.com.ar> Para: wx-users(a)lists.wxwidgets.org Enviado: jueves 17 de abril de 2008, 15:14:07 Asunto: Re: wxSimpleHtmlListBox size smaller than content requires I forgot to said, that I use: pScrollWindow_->SetScrollRate(10, 0); Alejandro ----- Mensaje original ---- De: Alejandro Mostovoi <a.mostovoi(a)yahoo.com.ar> Para: wx-users(a)lists.wxwidgets.org Enviado: jueves 17 de abril de 2008, 15:08:26 Asunto: wxSimpleHtmlListBox size smaller than content requires Hi!! I'm trying to use a wxScrolledWindow with a wxSimpleHtmlListBox inside, but the problem is that when I change the wxScrolledWindow 's size the HScrollBar set to disabled. when I change the size of the frame the wxScrolledWindow.GetClientSize(), the wxScrolledWindow..GetVirtualSize() and the wxSimpleHtmlListBox.GetSize() return the same values, hence there is no need for a scrollbar. But the wxSimpleHtmlListBox.GetSize() should be bigger because of it´s contents, and this should enable the scrollbar (because I set wxScrolledWindow´s virtualsize to this dimension). Could you help me to fix it?? In the constructor I have: wxFrame *pframe = this; pframe->Create(NULL,wxID_ANY,"My Frame"); pframe->SetSizer(psizerframe); pPanel_ = new wxPanel(pframe, wxID_PANEL1); psizerframe->Add(pPanel_, 1, wxEXPAND); pPanel_->SetSizer(psizerpanel); pScrollWindow_ = new wxScrolledWindow(pPanel_, wxID_SCROLLWINDOW); psizerpanel->Add(pScrollWindow_,1,wxEXPAND); pScrollWindow_->SetSizer(psizerscroll); pHtmlList_ = new wxSimpleHtmlListBox(); const wxString choices[] = {"Elemento_1", "Elemento_2_Nombre_corto.", "Elemento_3_Nombre_largo_aldfaldsfladfladkflasdfkalsdfkadlfkalkjfads."}; pHtmlList_->Create(pScrollWindow_, wxID_HTMLSIMPLELIST, wxDefaultPosition, wxDefaultSize, 3, choices); psizerscroll->Add(pHtmlList_,1,wxEXPAND); In the OnResize() I'm doing: m_ScrollWindow->SetVirtualSize(m_HtmlList->GetSize()); Regards. Alejandro Yahoo! Encuentros Ahora encontrar pareja es mucho más fácil, probá el nuevo Yahoo! Encuentros. Visitá http://yahoo.cupidovirtual.com/servlet/NewRegistration Los referentes más importantes en compra/venta de autos se juntaron: Demotores y Yahoo!.Ahora comprar o vender tu auto es más fácil. Visitá http://ar.autos.yahoo.com/ Tarjeta de crédito Yahoo! de Banco Supervielle. Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. www.tuprimeratarjeta.com.ar
|
Pages: 1 Prev: Re[2]: Hybrid GUI/Console App Next: Strange wxGTK behavior (was Re: wxDateTime (time_t) Save/Load) |