From b0c8fc357c366066db0c9d3655da9fe2345ad3be Mon Sep 17 00:00:00 2001 From: Michael Bedward Date: Thu, 24 Feb 2000 07:42:17 +0000 Subject: [PATCH] Several ugly hacks to get the bugs table and virtual table demos to work under wxMotif. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/newgrid/griddemo.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/samples/newgrid/griddemo.cpp b/samples/newgrid/griddemo.cpp index b936e76b78..63a6e544df 100644 --- a/samples/newgrid/griddemo.cpp +++ b/samples/newgrid/griddemo.cpp @@ -652,11 +652,24 @@ void GridFrame::OnVTable(wxCommandEvent& ) { static long s_sizeGrid = 10000; +#ifdef __WXMOTIF__ + // MB: wxGetNumberFromUser doesn't work properly for wxMotif + wxString s; + s << s_sizeGrid; + s = wxGetTextFromUser( "Size of the table to create", + "Size:", + s ); + + s.ToLong( &s_sizeGrid ); + +#else s_sizeGrid = wxGetNumberFromUser("Size of the table to create", "Size: ", "wxGridDemo question", s_sizeGrid, 0, 32000, this); +#endif + if ( s_sizeGrid != -1 ) { BigGridFrame* win = new BigGridFrame(s_sizeGrid); @@ -697,6 +710,13 @@ BigGridFrame::BigGridFrame(long sizeGrid) m_grid = new wxGrid(this, -1, wxDefaultPosition, wxDefaultSize); m_table = new BigGridTable(sizeGrid); m_grid->SetTable(m_table, TRUE); + +#if defined __WXMOTIF__ + // MB: the grid isn't getting a sensible default size under wxMotif + int cw, ch; + GetClientSize( &cw, &ch ); + m_grid->SetSize( cw, ch ); +#endif } // ---------------------------------------------------------------------------- @@ -983,4 +1003,11 @@ BugsGridFrame::BugsGridFrame() grid->SetColAttr(Col_Severity, attrCombo); grid->AutoSizeColumns(); + +#if defined __WXMOTIF__ + // MB: the grid isn't getting a sensible default size under wxMotif + int cw, ch; + GetClientSize( &cw, &ch ); + grid->SetSize( cw, ch ); +#endif } -- 2.45.2