Harbour Minigui

What`s MiniGui

MiniGUI is a GUI library for Harbour and xHarbour compilers.

The main purpose of MiniGUI is to give access to Windows API GUI elements in a easy way (hiding its inherent complexities).

MiniGUI is not class based (is not ‘real’ OOP). It implements a semi-oop model. My goal is to obtain most advantages of OOP hiding its ‘dark-side’ ;)

In my humble opinion, this model fits perfectly with xBase, because the goal of the original dBase creators was to obtain the maximum power with the minimum programming effort. This was the key for its tremendous
success.

In most cases, the xBase Windows products, consist of a xBase compiler tied to a standard OOP GUI engine, resulting in ‘schizoid’ languages, extremely easy to use in all aspects excepting the GUI.

I’ve tried create a GUI system consistent with xBase philosophy, without strictly regarding any standard programming paradigm.

Some ideas of MiniGUI’s semi-oop model were inspired by William Yu’s outstanding Rapid-Q basic compiler. I want to publicly thanks to him for his brilliant ideas and open minded vision of computer programming science.

HMG Extended Syntax Extensions

Harbour MiniGUI Extended Syntax Extensions


Harbour MiniGUI Extended is a fork up from Official HMG created March 2005. It aims to follow a more aggressive development path, and be more responsive to user’s input.

As it stands at this point, HMG Extended offers Syntax extensions over Official HMG, including:



BUTTONEX control – so-called OwnerDraw Buttons implementation with support for XP Style.
This button can use images (icons or bitmaps) and text together.
[Remark: Official HMG have a support for a similar feature but it doesn't work at Win9x.]


Example:


DEFINE BUTTONEX Button_Ex
ROW  10
COL  10
WIDTH  70
HEIGHT 70
CAPTION “Computer”
VERTICAL .T.
ICON “res\comp.ico”
FLAT .F.
FONTNAME  “MS Sans serif”
FONTSIZE  9
FONTCOLOR {0,128,0}
FONTBOLD .T.
BACKCOLOR {240,255,240}
UPPERTEXT .T.
TOOLTIP “Button with icon – vertical – uppertext – nohotlight – noxpstyle”
NOHOTLIGHT .T.
NOXPSTYLE .T.
END BUTTONEX



BTNTEXTBOX control – extended TEXTBOX control with inserted buttons.

Example:

DEFINE BTNTEXTBOX Text_Btn
ROW  10
COL  10
WIDTH 200
VALUE ”
ACTION MsgInfo(‘Click!’)
ACTION2 MsgInfo(‘Click Help Button!’)
PICTURE {“folder.bmp”,”help.bmp”}
BUTTONWIDTH 20
FONTNAME  “MS Sans serif”
FONTSIZE  9
TOOLTIP ‘Button TextBox’

END BTNTEXTBOX



COMBOBOXEX control – COMBOBOX which support of images for items
[Remark: COMBOBOX in Official HMG have the IMAGE property that allows (optionally) add images to the items, giving it the same functionality.]


Example:

DEFINE COMBOBOXEX ComboBox_Ex
ROW   10
COL   10
WIDTH 150
FONTNAME  ‘MS Sans serif’
FONTSIZE  9
LISTWIDTH 200
ITEMS {‘One’,’Two’,’Three’}
IMAGE {“br0″,”br2″,”br1″}
VALUE 3
TOOLTIP ‘ComboEx’
END COMBOBOXEX



GETBOX control – Windows implementation of Harbour`s GET Class


Example:


DEFINE GETBOX Get_1
ROW 10
COL 10
HEIGHT 21
VALUE DATE()
PICTURE ‘@K’
TOOLTIP “Date Value: Must be greater or equal to “+DTOC(DATE())
VALID {|| Compare(This.Value)}
VALIDMESSAGE “Must be greater or equal to “+DTOC(DATE())
MESSAGE
“Date Value”
BACKCOLOR {{255,255,255},{255,255,200},{200,255,255}}
FONTCOLOR {{0,0,0},{255,255,200},{0,0,255}}
END GETBOX




HotKeyBox control – standard control for hotkey’s input.

Example:

DEFINE HOTKEYBOX HotKey_1
COL 10
ROW 10
VALUE 0
WIDTH  100
HEIGHT 21
FONTNAME  “MS Sans serif”
FONTSIZE  9
TOOLTIP “HotKeyBox”
TABSTOP .T.
END HOTKEYBOX



IMAGELIST control – support for resources from bitmap’s list

- commands DEFINE IMAGELIST, DRAW IMAGELIST, RELEASE IMAGELIST
- commands ERASE IMAGE, BEGINDRAG IMAGE, ENTERDRAG IMAGE, ENDDRAG IMAGE, MOVE IMAGE

Look at folder Samples\Advanced\ImageList for sample.





TIMEPICKER control – similar to DATEPICKER control (with UPDOWN clause) but return time in format [HH:mm:ss]

Example:

DEFINE TIMEPICKER Time_1
ROW 10
COL 10
WIDTH 170
TOOLTIP “TimePicker Control with ShowNone”
SHOWNONE .T.
VALUE “12:10:22″
FONTBOLD .T.
TIMEFORMAT “‘Time’ HH:mm:ss”
END TIMEPICKER



TOOLBAREX control – toolbar with a clauses ROWS, TOOLBARSIZE, IMAGELIST, HOTIMAGELIST and MIXEDBUTTONS, support for CHEVRON menu

Look at folder Samples\Basic\ToolBarEx for samples.



PAGERBOX control allows the user to define a scrolling area for the toolbar buttons


Look at folder Samples\Basic\PagerBox for sample.




DEFINE DIALOG command – create a Dialog Box from resouces or without using resources:

- ID clause for Controls ANIMATEBOX, BROWSE, BUTTON, CHECKBOX, CHECKBUTTON, COMBOBOX, DATEPICKER, EDITBOX, FRAME, GRID, IMAGE, LABEL, LISTBOX, MONTHCALENDAR, PROGRESSBAR, RADIOGROUP, SLIDER, TEXTBOX, TAB, TREE

- Command REDEFINE Controls for ANIMATEBOX, BROWSE, BUTTON, CHECKBOX, CHECKBUTTON, COMBOBOX, DATEPICKER, EDITBOX, FRAME, GRID, IMAGE, LABEL, LISTBOX, MONTHCALENDAR, PROGRESSBAR, RADIOGROUP, SLIDER, TEXTBOX, TAB, TREE



DEFINE FOLDER command. A Folder allows the user to define multiple pages for the same area of dialog box from resources and without using resources.

- Folder from Resources:
DEFINE FOLDER <FolderName>
[ OF| PARENT> < ParentWindowName > ]
RESOURCE <res>
[ CAPTION <cCaption> ]
- Folder created from memory:
DEFINE FOLDER < FolderName >
[ OF| PARENT> < ParentWindowName > ]
AT <nRow>,<nCol>
[ WIDTH < nWidth > ]
[ HEIGHT <nHeight> ]
[ CAPTION <cCaption> ]
- Folder Page (Dialog box) from resources:
FOLDERPAGE <FolderNameRESOURCE <id>
[ TITLE <cTitle> ]
[ IMAGE <cImageName> ]
- Folder Page (Dialog box) with Controls created in Memory:
DEFINE FOLDERPAGE < FolderName >  [ RESOURCE <id> ]
[ TITLE <cTitle> ]
[IMAGE <cImageName> ]

… Control Definitions…

END FOLDERPAGE
END FOLDER




New commands:

CLEAN MEMORY – deallocating computer’s RAM at program start (for Win 2k/XP only)

DEFINE BKGBRUSH <brush> SOLID IN [ WINDOW ] <form> – similar to window Backcolor property
DEFINE BKGBRUSH <brush> HATCHED IN [ WINDOW ] <form>
DEFINE BKGBRUSH <brush> PATTERN IN [ WINDOW ] <form>

SET REGION OF <window> ROUNDRECT <nRect1>,<nRect2>,<nWidth>,<nHeight>
SET REGION OF <window> BITMAP <file | resource> TRANSPARENT COLOR <color> [ TO <region> ]

SET DEFAULT ICON TO <IconName> – the main icon could be used as default icon to all other windows

SET CENTERWINDOW RELATIVE PARENT | DESKTOP - the windows can be centered relative to the parent window

SET WINDOWPROPERTY <name> [ OF <form> ] VALUE <value> [ DIRECT ]
GET WINDOWPROPERTY <name> [ OF <form> ] VALUE <value> [ DIRECT ]

RELEASE WINDOWPROPERTY <name> [ OF <form> ] [ NOFREE ]

SET EVENTS FUNCTION TO <funcname> – define the user’s events handling function
[Remark: It require the knowledge of the low-level operating system internals.]

SET MENUSTYLE EXTENDED | STANDARD - define the OwnerDraw Menu style (similar to Delphi)
SET MENUCURSOR FULL | SHORT
SET MENUSEPARATOR [ SINGLE | DOUBLE ] [ LEFTALIGN | CENTERALIGN | RIGHTALIGN ]
SET MENUITEM BORDER 3D | FLAT

SET SHOWDETAILERROR ON | OFF - enable or disable showing the detail error message

SET LOGERROR ON | OFF - enable or disable logging errors to errorlog file
SET ERRORLOG TO <cFile> – set new errorlog file
SET ERRORLOG TO – reset errorlog file to default value

SET TOOLTIP ON | OFF - enable or disable control’s tooltip
SET TOOLTIP MAXWIDTH TO <w> OF <form>,
where <w> is the max width of tooltip’s string in pixels

ADD TOOLTIPICON [ INFO | WARNING | ERROR ] WITH MESSAGE <message> OF <form>
CLEAR TOOLTIPICON OF <form>

DEFINE FONT <font> FONTNAME <name> … [ ANGLE <angle>][ DEFAULT ]
The new Font definition supports an Angle clause for font’s rotation.

RELEASE FONT <font>
The defined fonts will be released automatically at program release (similar to Hotkeys).

DRAW TEXT IN WINDOW <form> – label which updated ON PAINT event
DRAW PANEL IN WINDOW <form> – draw box raised (panel)
DRAW BOX IN WINDOW <form> – draw box in
DRAW GRADIENT IN WINDOW <form> – draw gradient with using MsImg32.dll and Gdi32.dll

Individual context menu for controls (excluding Frame):
DEFINE CONTEXT MENU CONTROL <control> [ OF <parent> ]
DEFINE CONTEXT MENU CONTROLS <control1> [,<controln>] [ OF <parent> ]
SET CONTEXT MENU CONTROL <control> OF <parent> ON | OFF



New methods and properties for standard controls:

WINDOW - property Backcolor , MinWidth, MaxWidth, MinHeight, MaxHeight and event ON RESTORE and ON MOVEand ON DROPFILES and NotifyIconDblClick, method SaveAs( cBmpFile ) for windows and controls.

Semi-oop ‘Application‘ object. It will allow to read (and write when possible) various application MAIN window properties.

Read/write property ‘Cargo‘ for all standard controls.

GRID, BROWSE, COMBOBOX, TREE - methods EnableUpdate and DisableUpdate.

GRID, BROWSE - property ColumnWidth(n) and methods:
· ColumnAutoFit(n)  – set width of column <n>  to fit the column contents
· ColumnAutoFitH(n) – set width of column <n> to fit the columnheader text & column contents
· ColumnsAutoFit()  – set widths of all columns to fit each column contents
· ColumnsAutoFitH() – set widths of all columns to fit each columnheader text & column contents

GRID - read/write property ‘CheckboxItem’.

BUTTON, LABEL, TIMER - read/write property ‘Action’.

BUTTON - NOXPSTYLE clause.

CHECKBOX - THREESTATE and LEFTJUSTIFY clauses.

COMBOBOX - property ‘ListWidth’ for definition a width of dropdown list, properties ‘BackColor’ and ‘FontColor’, events ON LISTDISPLAY and ON LISTCLOSE.
[Remark: Official HMG COMBOBOX includes the following:
- DROPPEDWIDTH property (equivalent to ListWidth)
- ON DROPDOWN event (equivalent to On ListDisplay)
- ON CLOSEUP event (equivalent to On ListClose)
giving it the same functionality.]

DATEPICKER - property ‘FormatString’ and clause DATEFORMAT, BackColor, FontColor and others color clauses.

IMAGE - WHITEBACKGROUND clause.

LABEL - BLINK clause.

MONTHCALENDAR - BackColor, FontColor and others color clauses.

STATUSBAR item – read/write property ‘Width‘.

RADIOGROUP - LEFTJUSTIFY clause.

RICHEDIT - method Save, event ON SELECT, drag/drop/paste events, NOVSCROL, NOHSCROLL, FILE and FIELD clauses, ‘RichValue’ and ‘AutoFont’ properties.

SLIDER - ON SCROLL event.

TAB - property ‘Backcolor’.

TOOLBAR - WRAP clause.

TREE - properties ‘LineColor’, ‘Indent’, ‘ItemHeight’, ‘FontColor’ and ‘Backcolor‘.



New Function:

Functions _GetMenuItemCaption( ItemName , FormName ),
_SetMenuItemCaption(
ItemName , FormName , Caption ),
_SetMenuItemBitmap(
ItemName , FormName , Bitmap ),
_SetMenuItemFont(
ItemName , FormName , Font )

Functions    AddMRUItem(<NewItem>, “OnClickFunc(Item)”),
AddMenuElement(<NewItem>, “OnClickFunc(Item)”),
SaveMRUFileList(),
ClearMRUList()

Function MsgYesNoCancel()

Functions _ExtDisableControl ( ControlName, ParentForm ) and
_ExtEnableControl (
ControlName , ParentForm )
Using these functions we can disable/enable control without changing any other properties (i.e FontColor, Backcolor and so on)

Function GetUserName() return a name for current user.

Function _GetShortPathName( cPath ) return a short path name for specified full path.

Function _GetCompactPath( cFile, nMax ),
where:
cFile - string to be compacted (may be for example fullpath, path or file name)
nMax - required string size (characters count)

Function IsThemed() – for accurately detecting if an application is theme-enabled.



MDI support:

commands DEFINE WINDOW <…> MAIN MDI and DEFINE WINDOW <…> MDICHILD

Commands for MDI CHILD Windows support:

FETCH ACTIVE MDICHILD TO <…>
CLOSE ACTIVE MDICHILD
TILE MDICHILDS HORIZONTAL
TILE MDICHILDS VERTICAL
CASCADE MDICHILDS
ARRANGE MDICHILD ICONS
RESTORE MDICHILDS ALL
CLOSE MDICHILDS ALL

Look at folder Samples\Basic\mdi and Samples\Basic\mdi_2 for sample.


Windows Clipboard support:

CopyToClipboard(cText) – store cText in Windows clipboard
RetriveTextFromClipboard()->cText - retrieve text from Windows clipboard
[Remark: Official HMG includes System.Clipboard object providing the similar functionality.]
It was replaced by using the semi-oop ‘Clipboard’ object.
CopyRtfToClipboard(cRtfText) – store cRTFText in Windows clipboard


Optimizations

Default font name and font size if FontName, FontSize attributes are not defined in control’s definition.

Optimized Virtual Window scrolling.
[Remark: Official HMG have a support for a similar feature by SET SCROLLSTEP TO command.]



Enhanced

ErrorSys.prg

SET HELPFILE TO <hlp> command supports the help files in CHM format.

DO REPORT command uses an OEM to ANSI conversion if its needed only.

DO REPORT command have added a new features:
· Calculate the greater font for print fit in the choosen paper size
· Not necessary to put number of lines per page nor number of characters for each line
· Headers with a font on 2 points greater than rest
· Top margin clause
· Option ‘EVERY PAGE‘ for GROUPED BY clause

Function PutFile() supports an optional 5-th parameter for default filename.

Function InputWindow() supports an optional the 7-th parameter lCenterWindow and 8-th parameter with array of button’s caption.
It respects the defined default font by SET FONT TO command for all windows.

INI file – an integer value remains without a fractional part, two functions added _GetSectionNames() and _GetSection().

The ICON and NOTIFYICON clauses supports a resource identifier as integer value in the DEFINE WINDOW command.

The BUTTON control supports an icons (*.ico) from files or resource.

The BUTTON control supports a multiline caption.

The IMAGE BUTTON control with bitmap use mask, created on the fly, for disabled button state.
[Remark: Official HMG includes the similar functionality for image buttons.]


The IMAGE BUTTON control supports an extraction of icons (*.ico) from external files.

The ReadOnly state of EDIT controls family (TEXT & EDIT) preserve userdefined FontColor and BackColor properties.
[Remark: Official HMG have a support for a similar features by DisabledBackColor and DisabledFontColor properties for Edit and TextBox controls.]
We can also define these properties as array of RGB arrays { aEnabled, aReadonly }.

The MONTHCAL control supports setting of the first day of the week.

The MessageBox functions supports an optional parameters:
· nIcon - icon resource name (from resources)
· lSysModal - if set to false when MB_APPLMODAL+MB_TOPMOST style is used
· nDefaultButton - initial default button at MessageBoxes with 2 or 3 buttons

The SET NAVIGATION EXTENDED command supports backward moving by pressing Shift-Enter.

The EXECUTE FILE WAIT command supports an optional clauses: WHILE and INTERVAL.

The window MOUSECLICK event supports a right mouse click.

The ACTIVATE WINDOW command supports an optional NOWAIT clause.


The EDIT EXTENDED command shows the deleted records.

The Menu items supports Messages in the statusbar.

The MENUITEM command supports a DISABLED clause.

The MENUITEM command supports a CHECKMARK <image> and FONT <font> clauses.

The MENU POPUP command supports an IMAGE <image> clause.

The Main menu supports MRU[ITEM] menu command.

The default action on Statusbar Keyboard items toggles NumLock, CapsLock and Insert status on WinNT/2k/XP.

The StatusBar’s command CLOCK supports an optional AMPM clause.

The CONTEXT MENU and notify menu supports multistaged submenu.

The Browse and Grid controls supports an optional NOTABSTOP clause.

The GRID control supports an optional VALIDMESSAGES clause.

The GRID control supports an optional CHECKBOXES clause.

The CheckBox and Spinner controls supports the Extended Navigation.

The Tab control supports the adding of ToolTip to separate page instead to all Tab.

The Address property of HYPERLINK control can contain the file of folder name.

The DRAW GRAPH command supports an alternative syntax.

The DRAW GRAPH command supports SHOWDATAVALUES and DATAMASK clauses.

The COMPRESS command supports an optional PASSWORD clause.

The UNCOMPRESS command supports an optional FILEMASK | FILEARRAY clause.


Fixed

Filling of Tabs caption property in function _AddTabPage().

Updating of Tab control without any tabs in function UpdateTab().

Specifying the Max value for the identifier of the Hotkeys.



New libraries

The Shell32 library lets you copy, move, delete a files using the WinAPI SHFileOperation() function.
Look at folder Samples\Basic\shell32 for sample.

The TMsAgent library lets you manage the Microsoft Agents.
Look at folder Samples\Advanced\MsAgent for sample.

The HMG_QHTM library is based upon a freeware Qhtm.Dll from http://www.gipsysoft.com/qhtm/freedownload.shtml.
Look at folder Samples\Advanced\qhtm_2 for sample.


HBprinter library support

The full description is beyond the scope of this document – please refer to doc\MiniGUI.chm for help and samples\Advanced\HBPrint\demo.prg for sample.



TSBrowse library support

The full description is beyond the scope of this document – please refer to doc\TSBrowse.chm for help and samples\Advanced\TsBrowse\demo.prg for sample.



PropGrid library support

The full description is beyond the scope of this document – please refer to doc\MiniGUI.chm for help and samples\Advanced\PropGrid\demo.prg for sample.


PropSheet library support

The full description is beyond the scope of this document – please refer to doc\MiniGUI.chm for help and samples\Advanced\PropSheet\demo.prg for sample.


Thanks to many people at the following forums for contribution and feedback:






MiniGui – (c) 2003-2010 Roberto Lopez
Extended version – MiniGUI Team (Grigory Filatov,Jacek Kubica,Janusz Pora)
Edited by Janusz Pora



9 Tanggapan

  1. Bos gimana ya caranya dapatkan xharbour linux
    mandriva ato ubuntu ya kalu bisa ya trhird partynya dan builder nyo
    saya pusing tujuh keliling bos cari cari susah dapatnya klu yang windows banyak pirusnya bos
    thanks

    • Dear mas Imam,
      Mas imam , makasih telah berkenan memberi coretan pada blog saya ,

      Mas imam , mohon maaf saat ini saya memang cenderung fokus untuk mempelajari minigui extended dan berbagai turunannya dalam operating system window dan untuk linux memang saya sudah pelajari tapi belum terlalu fokus .

      Untuk window dng harbour saya berani share pengalaman serta sample2 aplikasi yg telah saya bikin dengan minigui extended

      Oh yaaa .. yang mas maksud banyak virusnya adalah Operating System Window atau Xharbournya

      Makasih

      • Blog Anda ini sangat bagus, apalagi buat orang seperti saya yg baru 3minggu nyobain minigui.

        Mas, bisa di bahas gak ya, koneksi ke database MS SQL 2008 dengan menggunakan minigui ??

        Trims ya, sebelumnya.

      • Dear Mas Fajar ,

        Makasih Banyak atas waktunya berkenan membuat coretan di blog saya.

        Mas Fajar , saat ini aplikasi yg saya kembangkan baru memakai 2 model database yaitu :
        1. DBF
        2.Mysql

        Untuk database MS SQL saya belum mencoba dan atas masukan mas fajar saya akan coba membikin dan samplenya saya akan upload codingnya di blog ini , insya allah minggu depan yaaaa..

        salam dan makasih

  2. mas Priadi
    tanya mas saya buka sample minigui ada file yang ber exten .fpt
    misal coba.fpt
    itu file apa mas dan bagamana cara membuka nya dan membuatnya
    terima kasih mas sebebelumnnya

    • Mas Imam ,

      File FPT merupakan file Memo bawaan dari Visual foxpro tetapi bisa dibuka dengan harbour atau minigui dengan perintah RddSetDefault(“DBFCDX”)

      Makasih dan smoga membantu

  3. Salam Harbour…
    kepada para master disini sekiranya ada yang tau ga cara bikin kombinasi tombol? misal mau print cukup tekan CTRL+P ? atau display (Alt+i). mohon pencerahannya para suhu. maaf saya masih pemula…

    • perintah yang mas arbi ada kok di harbour ;

      SYNTAX

      ON KEY ALT [ OF ] ACTION |

      REMARKS

      Key must be one of the following:

      ALT+A SHIFT+A CONTROL+A
      ALT+B SHIFT+B CONTROL+B
      ALT+C SHIFT+C CONTROL+C
      ALT+D SHIFT+D CONTROL+D
      ALT+E SHIFT+E CONTROL+E
      ALT+F SHIFT+F CONTROL+F
      ALT+G SHIFT+G CONTROL+G
      ALT+H SHIFT+H CONTROL+H
      ALT+I SHIFT+I CONTROL+I
      ALT+J SHIFT+J CONTROL+J
      ALT+K SHIFT+K CONTROL+K <
      ALT+L SHIFT+L CONTROL+L
      ALT+M SHIFT+M CONTROL+M
      ALT+N SHIFT+N CONTROL+N
      ALT+O SHIFT+O CONTROL+O
      ALT+P SHIFT+P CONTROL+P
      ALT+Q SHIFT+Q CONTROL+Q
      ALT+R SHIFT+R CONTROL+R
      ALT+S SHIFT+S CONTROL

      Silahkan di lihat di modul helpnya yang dapat di donwload di http://hmgextended.com/

      • Baik Pak, Terima kasih banyak atas bantuannya..lama tidak melanjutkan harbour, gara2 buntu…sekarang siap lembur minigui lagi.. blog bapak sangat membantu.Terima kasih.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Logout / Ubah )

Twitter picture

You are commenting using your Twitter account. Logout / Ubah )

Facebook photo

You are commenting using your Facebook account. Logout / Ubah )

Google+ photo

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Ikuti

Get every new post delivered to your Inbox.

%d bloggers like this: