Help with wxTextCtrl

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
alaricljs
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Jun 15, 2005 5:44 pm

Help with wxTextCtrl

Post by alaricljs »

I am trying to write a network address interface, and I cannot seem to get the wxTextCtrl widget to be smaller than ~100px wide. I am using wxGlade 0.3.5.1 to create the interface, however I'm not averse to modifiying it in dev-cpp.

Here's the wrong way:
Image

And here's the right way:
Image

Interestingly enough, the right way is how wxGlade displays the editable interface mockup, however the text isn't centered like it should be. The wrong way is how wxGlade's preview and the compiled version look, text is centered correctly, size is not correct.

To get the narrow width, I explicitly set the size to 30, 21 I have found no other way to get the size smaller in any view. I've tried playing with sizers and spacers, and haven't found anything that does anything to change the minimum size of the TextCtrl.

Heeeeelp!

Thanks,
Leeman
Dev-C++ 4.9.9.2
wxWidgets 2.6.1
wxGlade 0.3.5.1
WinXP SP2 (+all)
User avatar
Ryan Norton
wxWorld Domination!
wxWorld Domination!
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Post by Ryan Norton »

I don't use wxGlade, but maybe the wrong way is using sizers (maybe wxGlade uses them always?)? That's what it sure looks like.

Personally, I kind of like the wrong way better myself though :roll:
[Mostly retired moderator, still check in to clean up some stuff]
alaricljs
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Jun 15, 2005 5:44 pm

Post by alaricljs »

Got it solved, I had been using sizers and still am, just a matter of not being afraid to use alot of sizers.

I was previousy using a wxFlexGridSizer and for the address fields a horizontal wxBoxSizer with 7 fields (4 octets, 3 labels of ".").

Now it's a virtical wxBoxSizer containing 2 wxFlexGridSizer's. The top one contains the DHCP options, the bottom contains all the address fields and labels.

That's it. Apparently nothing to it.
Dev-C++ 4.9.9.2
wxWidgets 2.6.1
wxGlade 0.3.5.1
WinXP SP2 (+all)
Post Reply