I am new to Xojo so please forgive me if there is an obvious answer to my question…
I watched the basics of OOP in Xojo. OOP for methods and properties are of a medium importance for me. But, IMHO, OOP shines when it comes to GUI development.
For example, can I do this in Xojo:
Create a WebContainer class,
Add a few WebControls to that container,
Create subclasses of the container. The subclass should include all controls from the super/base class/container.
Another example,
How can I change style or behavior of all WebTextFields in my application? With OOP I would change style/behavior of the super/base class, and all subclasses would inherit from it.
If you want something like this, Create a container with the controls the way you want them and then create a new WebContainer and place the first on the second.
Hmmm, OOP works to a certain extend for UI - just on a basic level, I guess. Here is what I did:
I created a subclass of WebTextField named: WebTextField_1,
I created a subclass of WebTextField_1 named: WebTextField_2,
I added code to the Shown event of WebTextField_1.
I put both WebTextField_1 and WebTextField_2 on a web page and the code was executed on both controls.
GREAT!
However,
I cannot set any properties of WebTextField subclasses (I have to put the control on a webpage or container to be able to modify any property, like, size, style etc., and that precludes subclassing)
I can create subclasses of containers, but they don’t inherit controls.
[Create a container with the controls the way you want them and then create…]
Yes, I will have to figure out a methodology.
I was really looking forward to using OOP in UI development. It would help me with consistency and quick UI changes across the whole app… I will have to figure out how to handle it…