wxSlider Labels
BlitzMax Forums/Brucey's Modules/wxSlider Labels
| ||
Am after a few ideas on how I might get some text labels to Align with the indentations on a vertical wxSider. I have tried many combinations of sizers without much success. Here is what I am trying to achieve. - | - Label 1 - | - Label 2 -[o]- Label 3 - | - Label 4 - | - ... - | - - | - - | - |
| ||
How about a custom control, which perhaps has in it, a slider and a panel. On the panel you place the labels at the correct vertical positions (however that needs to be calculated). |
| ||
Here is a link to what I have, it all looks very good but when you move to OS X, all the labels are a different size and no longer match up. Perhaps you could elaborate on your suggestion Brucey? Form.fbp |
| ||
Hmm.. I got this working (on Mac at least) using sliders : slider_label_test.fbp Though you may not be able to load it into your prog, as it's a v1.9 format file... So, here's what I did : Use a flexgridsizer to hold the labels. 6 rows, 1 col. growablerows = 0,1,2,3,4 It appears to lay them out as I hoped for. Which is, to divide them equally between top and bottom. Hopefully that'll work in the same way on win32 too... |
| ||
Brucey, file loads on the Mac version so I could look at what you have done. After converting it back to earlier format file. I get an error in the generated source:Local fgSizer2:wxFlexGridSizer fgSizer2 = New wxFlexGridSizer.CreateRC(6, 1, 0, 0) fgSizer2.AddGrowableRow( 0,1,2,3,4 ) fgSizer2.SetFlexibleDirection( wxBOTH ) fgSizer2.SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ) m_staticText1 = New wxStaticText.Create(m_panel1, wxID_ANY, _("MyLabel")) m_staticText1.Wrap(-1) fgSizer2.Add(m_staticText1, 0, wxALL, 5) on line three of that source snippit I get an error: "Compile Error To many function parameters" |
| ||
Ahh... indeed, the C++ looks like this :fgSizer2->AddGrowableRow( 0 ); fgSizer2->AddGrowableRow( 1 ); fgSizer2->AddGrowableRow( 2 ); fgSizer2->AddGrowableRow( 3 ); fgSizer2->AddGrowableRow( 4 ); String Split here we come... |
| ||
Brucey, waht about the optional grow parameter?fgsizer2.AddGrowableRow(0,1) |
| ||
wxFormBuilder doesn't seem to support that... therefore I think we'll have to live with matching its suggested output for now. I suspect you'd need a better way of inputting that information. |