Hmg4 stylesheet
Posted: Fri Mar 11, 2011 8:35 pm
Hello everyone.
I'm doing some tests to learn how to use the QT library and attempt to understand how to improve the HMG4 library
Among the many things I saw, I came across in education ":setStyleSheet" and consequently with the methods "BackColor", "FontColor", etc. I have noticed little problems (I think coming with QT use ).
I would like to propose the of introduce a new method in the HMG4 library, which could be called "StyleSheet", which would allow several things, for example to define the background color (background-color :#...), text color (color :#... ), the border (border-width :...) and also allow the use of images as background ("background-image: url (':/resources/BACKGROUND')" ). Yes, I remember HMG3 compatibility problem, but I said "introduce a new ...."
This method should be included twice (unfortunately and read below) inside "control.prg" and "window.prg"
This fact made me re-think in general and to test my theories, I have tried to replicate some pieces of HMG4 (can be found here included).
I have found that taking some actions we could improve HMG4 or we can make the code more efficient.
I refer in particular to the classes and their inherit.
If you compare my work with HMG4, you can note that both the sources "lforms" and "llabel" are inherit from "lcorebase", while in HMG4 (other names) is not the same.
Using this concept, I think we have a general container for all data and methods (generalized) and each control (form, label, textbox) can use one or more of them. Other data or methods can be specialized for control (eg. Icon and SetWindowIcon are used by forms not in label)
Some HMG4 source are like I describe, but not to all and this could become a problem in the future.
(Note. If you want to compile my version, you must edit the files: "pgm001.hbc", "pgm001.hbp" and "qt.conf" in accordance with your installation. At this point you can compile with hbmk2 without HMG4 lib )
I would like to clarify that about the code I've written and comments made, I got them in good faith and to contribute to the development of HMG4 that collecting my interest.
Returning to the main reason of my post (stylesheet), I wanted your opinion and than I will try to offer something (but I think with some little problems like described)
Cheers.
I'm doing some tests to learn how to use the QT library and attempt to understand how to improve the HMG4 library
Among the many things I saw, I came across in education ":setStyleSheet" and consequently with the methods "BackColor", "FontColor", etc. I have noticed little problems (I think coming with QT use ).
I would like to propose the of introduce a new method in the HMG4 library, which could be called "StyleSheet", which would allow several things, for example to define the background color (background-color :#...), text color (color :#... ), the border (border-width :...) and also allow the use of images as background ("background-image: url (':/resources/BACKGROUND')" ). Yes, I remember HMG3 compatibility problem, but I said "introduce a new ...."
This method should be included twice (unfortunately and read below) inside "control.prg" and "window.prg"
This fact made me re-think in general and to test my theories, I have tried to replicate some pieces of HMG4 (can be found here included).
I have found that taking some actions we could improve HMG4 or we can make the code more efficient.
I refer in particular to the classes and their inherit.
If you compare my work with HMG4, you can note that both the sources "lforms" and "llabel" are inherit from "lcorebase", while in HMG4 (other names) is not the same.
Using this concept, I think we have a general container for all data and methods (generalized) and each control (form, label, textbox) can use one or more of them. Other data or methods can be specialized for control (eg. Icon and SetWindowIcon are used by forms not in label)
Some HMG4 source are like I describe, but not to all and this could become a problem in the future.
(Note. If you want to compile my version, you must edit the files: "pgm001.hbc", "pgm001.hbp" and "qt.conf" in accordance with your installation. At this point you can compile with hbmk2 without HMG4 lib )
I would like to clarify that about the code I've written and comments made, I got them in good faith and to contribute to the development of HMG4 that collecting my interest.
Returning to the main reason of my post (stylesheet), I wanted your opinion and than I will try to offer something (but I think with some little problems like described)
Cheers.