center alignment in wxFlexGridSizer?
BlitzMax Forums/Brucey's Modules/center alignment in wxFlexGridSizer?
| ||
When I add the wxALIGN_CENTER or wxCENTER flag to a widget it is not centered. Other flags fail as well. Is this a bug? I modified the flexgrid example a little: thx |
| ||
Is this a bug? Possibly. I'll look into it :-) |
| ||
Try this instead :fgs.Add(review, 1, wxALIGN_BOTTOM) I used wxFormBuilder to try out different things - helps to quickly see what happens when you change flags/styles. |
| ||
I tried wxALIGN_BOTTOM/wxBOTTOM and wxALIGN_CENTER/wxCENTER and wxALIGN_RIGHT/wxRIGHT etc. but none of them has any effect in the example above. If it works in wxFormBuilder it is possibly a bug? |
| ||
I tried it in your above example and it worked for me (on OS X). I also just this moment re-tried the above example on Linux and it also worked for me with my above-mentioned change. |
| ||
Using UNZs example, all 3 labels are top-aligned. Changing to "wxALIGN_BOTTOM" moved the review-label to the bottom (as wanted). bye Ron |
| ||
You're right. It works. But only without wxEXPAND set. So fgs.Add(review, 1, wxALIGN_BOTTOM)works and fgs.Add(review, 1, wxEXPAND | wxALIGN_BOTTOM)don't. But that is enough for me. |
| ||
But only without wxEXPAND set. That's because you are aligning the static text control, not the contents of the static text. When you use wxEXPAND, the static text control fills the whole space from the top of the multi-line textbox to the bottom, and therefore using TOP or BOTTOM would show no difference. |
| ||
The behaviour is logical as soon as you can align the content, else each special alignment (left, right, top, bottom - contrary to "use all space") should be "intelligent" enough to be considered for content. But that would be a mistake made by wxWidgets, not your implementation. bye Ron edit: spelling bee was there for corrections. |
| ||
Makes sense. |