I've answered that question hundred times...
Most OOP implementations at the time that I've started MiniGUI library, were ugly, obscure, difficult and clumsy. Writing simple programs using such tools could be a terrible nightmare.
By the other hand I've had good experiences with VB, VFP and RapidQ and since that was nothing similar in the Harbour world, I've took some things of those products and put it together in HMG.
But I've must admit that was a misconception from my part.
Harbour OOP implementation is very powerful and flexible enough to allow the creation of a simple and easy to use OOP layer for any purpose (including a GUI library).
My main goals were:
1. Hide all standard HMG windows and control handling peculiarities to the OOP programmers, in such way that their experience be similar to the one using Clipper predefined classes.
2. Keep the things simple in such way that preprocessor directives be not necessary.
Here is a sample that creates a main window and a frame inside it:
Code: Select all
*-------------------------------------------------------*
Local oFrame
Local oWindow
* Window Definition *
With Object oWindow := Window():New()
:Row := 10
:Col := 10
:Width := 400
:Height := 400
:Title := 'Nice OOP Demo!!!'
:WindowType := WND_MAIN
:OnInit := { || oWindow:Center() }
End With
* Frame Definition *
With Object oFrame := Frame():New()
:Parent := oWindow
:Row := 10
:Col := 10
:Width := 350
:Height := 340
:Caption := 'This is an OOP Frame!!!'
End With
oWindow:Activate()
*-------------------------------------------------------*
Code: Select all
*-------------------------------------------------------*
Local oFrame
Local oWindow
* Window Definition *
oWindow := Window():New()
oWindow:Row:= 10
oWindow:Col:= 10
oWindow:Width:= 400
oWindow:Height:= 400
oWindow:Title:= 'Nice OOP Demo!!!'
oWindow:WindowType:= WND_MAIN
oWindow:OnInit:= { || oWindow:Center() }
* Control Definition *
oFrame := Frame():New()
oFrame:Parent:= oWindow
oFrame:Row:= 10
oFrame:Col:= 10
oFrame:Width:= 350
oFrame:Height:= 340
oFrame:Caption:= 'Hi OOP!!!'
oWindow:Activate()
*-------------------------------------------------------*
Enjoy!
PS: OOP programmers... Welcome to HMG too