HMG 2.6.7 -> Harbour MiniGUI 1.6 Extended Edition (Build 63)

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
volkix
Posts: 2
Joined: Sun Mar 01, 2009 6:52 pm

HMG 2.6.7 -> Harbour MiniGUI 1.6 Extended Edition (Build 63)

Post by volkix » Sun Mar 01, 2009 7:00 pm

Hello,
what is the big difference between HMG 2.6.7 and HMG-extended 1.6? Which version should I use?

Regards

Volker

User avatar
gfilatov
Posts: 561
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 14 times
Been thanked: 126 times
Contact:

Post by gfilatov » Sun Mar 01, 2009 7:20 pm

volkix wrote: what is the big difference between HMG 2.6.7 and HMG-extended 1.6?
Hello Volker,

Please be so kind to review the following document:
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.

Example:

Code: Select all

   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 button.

Example:

Code: Select all

   DEFINE BTNTEXTBOX Text_Btn
      ROW  10
      COL  10
      WIDTH 200
      VALUE ''
      ACTION MsgInfo('Click!')
      PICTURE "folder.bmp"
      BUTTONWIDTH 20
      FONTNAME  "MS Sans serif"
      FONTSIZE  9
      TOOLTIP 'Button TextBox'
   END BTNTEXTBOX
--------------------------------------------------------------------------------

COMBOBOXEX control - combobox which support of images for items

Example:

Code: Select all

           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

Syntax:

Code: Select all

@ <nRow> ,<nCol> GETBOX <ControlName> 
[ ID <nId> ]
[ OF | PARENT | DIALOG <ParentWindowName> ]
[ HEIGHT <nHeight> ] 
[ WIDTH <nWidth> ] 
[ FIELD <FieldName> ]
[ VALUE <nValue> ] 
[ PICTURE <cPicture> ] //**  format function and template string       
[ VALID <valid> | RANGE <min>,<max>] // VALID - postvalidation function or codeblock which must return logical value    
				     // RANGE - allowed range of values          
[ VALIDMESSAGE <cValidMessage> ]
[ MESSAGE <cMessage> ] // text to display on STATUSBAR Item(1) when getbox have focus
[ WHEN <when>   ] // prevalidation function or codeblock (if return .f. GetBox is readonly              
[ READONLY ] 
[ FONT <cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ PASSWORD ] 
[ TOOLTIP <cToolTipText> ]
[ BACKCOLOR <aBackColor> ] // * or <aBackColor,aReadOnlyBackColor,aAciveBackColor>
[ FONTCOLOR <aFontColor> ]  // * or <aFontColor,aReadOnlyFontColor,aActiveFontColor>
[ ON CHANGE <uChange> ]    ;
[ ON GOTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ] 
[ RIGHTALIGN ]
[ INVISIBLE ] 
[ NOTABSTOP ]
[ HELPID <nHelpId> ]

** GETBOX supported PICTURE Format Functions

Function Type Action
------------------------------------------------------------
A C Allows only alphabetic characters.
B N Displays numbers left-justified.
C N Displays CR after positive numbers.
D D,N Displays dates in SET DATE format.
K ALL Deletes default text if first key is not a cursor key.
X N Displays DB after negative numbers.
Z N Displays zero as blanks.
( N Displays negative numbers in parentheses with leading spaces.
) N Displays negative numbers in parentheses without leading spaces.
! C Converts alphabetic character to uppercase.

!>> unsupported Format Functions from Harbour Get class :
R C Nontemplate characters are inserted in the display
but not saved in the variable.
S<n> C Allows horizontal scrolling within a GET. <n> is
E D,N Displays dates with day and month inverted
independent of the current DATE SETting, numerics
with comma and period reverse (European style).
an integer that specifies the width of the region.


** GETBOX supported PICTURE Template Symbols
------------------------------------------------------------
Template Action
------------------------------------------------------------
A Allows only alphabetic characters
N Allows only alphabetic and numeric characters
X Allows any character
9 Allows digits for any data type including sign for numerics
# Allows digits, signs and spaces for C,N type
L Allows only T, F, Y or N
Y Allows only Y or N
! Converts an alphabetic character to uppercase
$ Displays a dollar sign in place of a leading space in a numeric
* Displays an asterisk in place of a leading space in a numeric
. Displays a decimal point
, Displays a comma


* FontColor and BackColor property can be defined as RGB array or array of RGBArrays
for Enable ,ReadOnly and Focused (active) stage.

* ReadOnly stage preserve defined FontColor and BackColor

* VALID and RANGE clauses are checked when control lost focus
User can not leave control if defined validation function (or codeblock) return false
or entered value is out of defined range. (These clauses can not be used together!)

* WHEN clause is checked when control become focus . If defined here function or codeblock
used as WHEN param return false, control status is changed to "noneditable".

Example:

Code: Select all

        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:

Code: Select all

   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:

Code: Select all

   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.

--------------------------------------------------------------------------------

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 <FolderName> RESOURCE <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 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

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 - properties Backcolor, Topmost, MinWidth, MaxWidth, MinHeight, MaxHeight and events ON RESTORE, ON MOVE, ON DROPFILES and
NotifyIconDblClick, method SaveAs( cBmpFile ) for windows and controls.

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

GRID, BROWSE - property ImageHeader, 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

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

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.

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 - Width Read/Write property.

RADIOGROUP - HORIZONTAL and LEFTJUSTIFY clauses.

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.

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

--------------------------------------------------------------------------------

New functions:

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

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 folders Samples\Basic\mdi and Samples\Basic\mdi_2 for samples.

--------------------------------------------------------------------------------

Windows Clipboard support:

CopyToClipboard(cText) - store cText in Windows clipboard
RetriveTextFromClipboard()->cText - retrieve text from Windows clipboard
CopyRtfToClipboard(cRtfText) - store cRTFText in Windows clipboard

--------------------------------------------------------------------------------

Optimizations

Optimized font and image management.

Optimized Virtual Window scrolling.

--------------------------------------------------------------------------------

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 GetFile()

Function PutFile()

Function InputWindow()

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 also 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.

The TEXTBOX and EDITBOX controls support insert/overwrite mode (regarding to <Ins> key global status).

The ReadOnly state of EDIT controls family (TEXT & EDIT) preserve userdefined FontColor and BackColor properties.
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 command supports messages in the statusbar.

The MENUITEM command supports a DISABLED clause.

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

The default action on Statusbar Keyboard items toggle 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 CheckBox control supports an Extended Navigation.

The Spinner control supports an Extended Navigation.

The Tab control supports an optional MULTILINE clause.

The ComboBox control restores an original Value at the Refresh method similar to the Refresh methods in the others controls.

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 Registry class supports the numeric datatype value as DWORD registry value.

The Socket library have a minor corrections for proper working with a new Harbour issues.

--------------------------------------------------------------------------------

Fixed

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

Grid problem with first element of array for picture manage.

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 and folders using the WinAPI SHFileOperation() function.
Look at folder Samples\Basic\shell32 for sample.

The TMsAgent library lets you to manage the Microsoft Agents.
Look at folder Samples\Advanced\MsAgent 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.
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

volkix
Posts: 2
Joined: Sun Mar 01, 2009 6:52 pm

Post by volkix » Sun Mar 01, 2009 9:38 pm

Hi Grigory,
thank you. i´ll try the extended version.

regards
volker

Post Reply