Would anyone know how to adjust the width of a wxtextCtrl in c++ code? I'm referring to the length of the actual widget.
Thanks
wxtextCtrl - Width (adjusting in code)
Re: wxtextCtrl - Width (adjusting in code)
You meant, adjust the width with its content?
In fact, you can simply manage it in a sizer, with wxEXPAND flag if it layout in a vertical sizer
In fact, you can simply manage it in a sizer, with wxEXPAND flag if it layout in a vertical sizer
Slackware GNU/Linux x86_64
wxWidgets-3.3.0
wxWidgets-3.3.0
Re: wxtextCtrl - Width (adjusting in code)
I actually meant the size of the widget.
For example.. Lets say the widget (text control for example) is 100 wide. That is the physical length of the widget in the form is 100 wide as it appears.
How do I make an empty widget (lets say a text control) wider. Not character length or the length it can hold, but the actual appearance of the widget wider, longer etc? It's purely for appearance.
I can do this in the properties of the text control by setting the width to x lets say 100, but I don't know how to do it in my code?
For example.. Lets say the widget (text control for example) is 100 wide. That is the physical length of the widget in the form is 100 wide as it appears.
How do I make an empty widget (lets say a text control) wider. Not character length or the length it can hold, but the actual appearance of the widget wider, longer etc? It's purely for appearance.
I can do this in the properties of the text control by setting the width to x lets say 100, but I don't know how to do it in my code?
Re: wxtextCtrl - Width (adjusting in code)
wxWindow::SetSize
http://docs.wxwidgets.org/stable/wx_wxw ... dowsetsize
http://docs.wxwidgets.org/stable/wx_wxw ... dowsetsize
Use the source, Luke!
Re: wxtextCtrl - Width (adjusting in code)
Thanks for that but I'm still very confused.
I have the wxWidgets book and the website but I can't seem to make sense of wxWindow.
I want to change the width of wxTextCtrl1 but not sure how that relates to wxWindow.
I'm going to guess what this means. Do I use wxWindow::SetSize('and in here use the wxTextCtrl as an argument).. is this right? Or do I need to do something to refer to wxWindow to relate it to wxTextCtrl first?
Very very confused..
I have the wxWidgets book and the website but I can't seem to make sense of wxWindow.
I want to change the width of wxTextCtrl1 but not sure how that relates to wxWindow.
I'm going to guess what this means. Do I use wxWindow::SetSize('and in here use the wxTextCtrl as an argument).. is this right? Or do I need to do something to refer to wxWindow to relate it to wxTextCtrl first?
Very very confused..
Re: wxtextCtrl - Width (adjusting in code)
wxWindow is a base object of wxTextCtrl. The wxTextCtrl inherits all wxWindow methods and data (and adds wxTextCtrl specific ones). Therefore, all wxWindow methods can be used from wxTextCtrl as if they were wxTextCtrl methods. For example SetSize(). You don't need to qualify by wxWindow::SetSize().
It's a general concept of OOP. Every time you can't find something in a particular object which should be there, search predecessors. Perhaps, some predecessor has already defined it and the descendant has inherited it and needed not to define it again.
It's a general concept of OOP. Every time you can't find something in a particular object which should be there, search predecessors. Perhaps, some predecessor has already defined it and the descendant has inherited it and needed not to define it again.
Re: wxtextCtrl - Width (adjusting in code)
Thanks very much, that's a really good explanation.
I'm assuming this means that I can place wxTextCtrl2->SetSize() in my code and it will work like SetSize is wxTexCtrl2's method?
Thanks
I'm assuming this means that I can place wxTextCtrl2->SetSize() in my code and it will work like SetSize is wxTexCtrl2's method?
Thanks
Re: wxtextCtrl - Width (adjusting in code)
Disregard my last post. It works exceptionally well. Thanks for the help.