Contributed samples by Agil Abdullah
BosTaurus Show – Digital Artist
BosTaurus Show – Digital Artist
Another Load / Save array sample, this time for ANY array.
This sample load an external ANY array from a text file to the GRID and upon exit save it to the file.
For manipulating on the array into program we are using a GRID control.
All critics and suggestions are welcome.
By Sri Rathinagiri » Mon Sep 08, 2014 12:44 pm
Clipper programmers sometimes find it difficult to accommodate with HMG. The reason is the difference between TUI (Text User Interface) and GUI. In GUI, the program control is in the hands of the user and it is event driven. User can click on anything (say minimize button, maximize button, even another program running behind or any controls). So, it is our duty to design the whole window and wait for user’s action and write procedures for each and every action of the user.
GUI offers many innovative controls like Grid, Combobox, Button, Spinner etc., as against only textbox in TUI. So, we have to eventually accommodate events for all these controls.
Now, coming to HMG as not only a GUI library but a bundle of all. Even though HMG is directly based on the latest Harbour versions, HMG comes as a bundle. You need not install any other software to build a windows application. Full stop. 🙂 It contains the GUI library, PRG compiler, C Compiler and all the supporting software products to successfully build an application.
People (at least me) sometimes misunderstand GUI and OOP as one and the same. GUI and OOP are different and independent to each other. GUI can be made to work with or without OOP and vice versa. HMG is based on Win32 API system. Win32 API system works on handles and hooks. Every window/control in HMG is provided with a handle (like the file handle in clipper) and events are hooked on that particular handle. Once any hooked event is fired by the user (say a click of a button) immediately Win32 API searches for a CallBack function which is provided by the developer via HMG. The beauty of HMG would be, the developer is made free from handling all these internal affairs, handles, hooks and callback procedures. Instead he can concentrate on what is to be done if the event is fired.
You will be astonished to see how a ‘define window’ statement in HMG invokes 100s of lines of Harbour and C code. Please see the source folder of HMG if you want to know in detail.
Again, the advantage of HMG is, you need not include any dlls with your executable code as it is based on Win32 API. The application would run in XP to Windows version 8 (even in Windows 97 some cases).
Now coming to your questions.
To answer this questions, pls help us by showing links which permit us to download. And by sharing your source-code available for public.
Screenshoot attached herein, is a sample screen handle we need to implement on our application, ASAP. Being programmers for long time, we need any advanced skill in order to satisfy our users/clients currently still using our DOS-apps-versions.
You can start with Your HMG Directory\SAMPLES\Basics\TUTORIAL folder. It contains various tutorials for basic programmers. Then you can see basic and controls sub-folders of samples. I don’t think that any advanced skill set is required to satisfy our existing DOS clients. Actually ther will be happy to update their programs to Windows version as it is user friendly and more flexible.
This problem never arise under DOS who own a single window. I noticed when exercising HMG-ID (executing IDE.EXE) to build project, the RUN (F5) function fails to detect the problem. that’s way HMG-IDE made run-time error as if the mistake came from source program.
Yes, it is a valid point. In HMG-IDE previous version there was an error marking ‘Is the program still running?’. I don’t know what happened to that in the recent versions. I will request Claudio to look into this. Thanks for reporting.
The project says the latest stable version is 3.0.0. while this forum says HMG 3.3.1. Any clarification in this matter is urgently needed to avoid confusion.
Because they are entirely different projects. As I have discussed earlier, HMG is based on Harbour. But it is a bundle by itself. Some major implementations have been made after the versions HMG 3.0. Introducing Unicode in 3.1. Made it to a stable version in 3.2. And the latest and significant achievement is HMG in 64 Bits, which made it to 3.3 series.
HMG Extended is also developed and released parallelly and they have their own version numbering system.
IMHO, we can use the latest stable versions for the development.
Harbour compiler is the core. Habour MiniGUI is the Win32 wrapper library to access the GUI aspects of the programs. HMG IDE is a tool to develop and build our software in Harbour MiniGUI.
You can use simply Harbour if you need only console mode. If you want GUI support, you can use Harbour MiniGUI and its build.bat ( even without using HMG IDE at all).
If you need Forms Designer and an easy build system, you can use HMG IDE which can co-ordinate your forms, database, resources (icons, pictures etc) and linking other third party libraries.
Sri Rathinagiri
Sivakasi, India
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Courtesy of author, this article borrowed from here.
1) internal change in Dynamic Back and Fore Color in Grid (now is more efficient, was removed the use of an array with an element for each cell, avoid create a huge array).
2) New Dynamic Font in Grid and Tree controls
New features:
* GRID
– <ParentWindowName>.<GridControlName>.Image ( lTransparent ) := { “image1.png”, “image2.bmp”, … }
– <ParentWindowName>.<GridControlName>.ImageIndex ( nRow , nCol )
– <ParentWindowName>.<GridControlName>.ImageList
– <ParentWindowName>.<GridControlName>.DYNAMICFONT ( nCol ) := {|| {cFontName, nFontSize, [ lBold, lItalic, lUnderline, lStrikeOut ]} }
– <ParentWindowName>.<GridControlName>.HeaderImageIndex ( nCol ) [ := | –>] nIndex
– <ParentWindowName>.<GridControlName>.ChangeFontSize := nSize | NIL // Useful for use Dynamic Font with more (less) Height than the size of font the Grid/Tree control
// Dynamic Font (Grid/Tree)
ARRAY FONT <cFontName> SIZE <nFontSize> [ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ] –> { cFontName, nFontSize, lBold, lIitalic, lUnderline, lStrikeout }
// Dynamic Font (Grid/Tree)
CREATE ARRAY FONT <cFontName> SIZE <nFontSize> [ BOLD <lBold> ] [ ITALIC <lIitalic> ] [ UNDERLINE <lUnderline> ] [ STRIKEOUT <lStrikeout> ] –> { cFontName, nFontSize, lBold, lIitalic, lUnderline, lStrikeout }
* Tree Control
– ON EXPAND
– ON COLLAPSE
– This.TreeItemValue
– <ParentWindowName>.<TreeControlName>.DynamicForeColor := cBlock
– <ParentWindowName>.<TreeControlName>.DynamicBackColor := cBlock
– <ParentWindowName>.<TreeControlName>.DynamicFont := cBlock
– <ParentWindowName>.<TreeControlName>.ChangeFontSize := nSize | NIL // Useful for use Dynamic Font with more (less) Height than the size of font the Grid/Tree control
– <ParentWindowName>.<TreeControlName>.IsExpand ( nValue ) –> lBoolean
– <ParentWindowName>.<TreeControlName>.ImageList [ := | –> ] hImageList
– <ParentWindowName>.<TreeControlName>.HasLines [ := | –> ] lBoolean
– <ParentWindowName>.<TreeControlName>.FullRowSelect [ := | –> ] lBoolean
– <ParentWindowName>.<TreeControlName>.HasButton ( nValue ) [ := | –> ] lBoolean
– <ParentWindowName>.<TreeControlName>.Cargo ( nValue ) [ := | –> ] xData
– <ParentWindowName>.<TreeControlName>.CargoScan ( xData ) –> nValue | NIL
– <ParentWindowName>.<TreeControlName>.GetPathValue ( nValue ) –> anPathValue | NIL
– <ParentWindowName>.<TreeControlName>.GetPathName ( nValue ) –> acPathName | NIL
– <ParentWindowName>.<TreeControlName>.GetDisplayLevel ( nValue ) –> nDisplayColumn | NIL
File Name: HMG.3.3.1.exe
File Size: 46.91 MB
Date: 15. July 2014
Description:
-HMG 3.3.1 (Stable) 2014/07/15
– Updated to latest Harbour Nightly Build (2014-07-15)
– New property in Label control
– NoPrefix
– New New property in DatePicker control
– FORMAT <cFormatDate> (see demo)
– New Now all controls (Button, CheckButton, ToolBarButton, ComboBox, Grid, Tab, Tree, Menu, etc) loaded images: BMP, GIF, TIF, JPG and PNG
– New Now all controls (Button, CheckButton, ToolBarButton, ComboBox, Grid, Tab, Tree, Menu, etc) support the NOTRANSPARENT property
– New Grid control support the NOTRANSPARENTHEADER property
– New Print images in formats: BMP, GIF, JPG, TIF, WMF, EMF, CUR and PNG.
- @ <nRow> , <nCol> PRINT IMAGE <cImageFileName> | <cImageResourcename> WIDTH <nWidth> HEIGHT <nHeight> [ STRETCH ] [ TRANSPARENT ] [ TRANSPARENTCOLOR anTransparentColor ]
– New functions for read Keyboard and Mouse (see doc)
– SET CONTROL <ControlName> OF <FormName> ONKEYEVENT <FuncName> | NIL
– SET CONTROL <ControlName> OF <FormName> ONMOUSEEVENT <FuncName> | NIL
– HMG_GetOnKeyControlIndex ( [ @nSubIndex ] ) –> nIndex
– HMG_GetOnMouseControlIndex ( [ @nSubIndex ] ) –> nIndex
– New functions for control edge (see doc)
– SET CONTROL <ControlName> OF <FormName> CLIENTEDGE
– SET CONTROL <ControlName> OF <FormName> STATICEDGE
– SET CONTROL <ControlName> OF <FormName> NOTEDGE
– New Functions:
– GetKeyboardLayoutName()
– ActivateKeyboardLayout()
– GetKeyboardLayout()
– GetKeyboardLayoutList()
– LoadKeyboardLayout ()
– UnloadKeyboardLayout()
– TerminateProcess ( [ nProcessID ] , [ nExitCode ] )
– GetWindowThreadProcessId (hWnd, @nThread, @nProcessID)
– IsWow64Process ( [ nProcessID ] ) –> return lBoolean
– return TRUE if a 32-bit application is running under 64-bit Windows (WOW64)
– return FALSE if a 32-bit application is running under 32-bit Windows
– return FALSE if a 64-bit application is running under 64-bit Windows
– WOW64 is the x86 emulator that allows 32-bit Windows-based applications to running on 64-bit Windows
– New: VirtualKeyboard (see doc)
– VirtualKeyboard.OPEN [ SHOW ]
– VirtualKeyboard.OPEN HIDE
– VirtualKeyboard.Show
– VirtualKeyboard.Hide
– VirtualKeyboard.Release
– VirtualKeyboard.IsRelease
– VirtualKeyboard.IsOpen
– VirtualKeyboard.IsVisible
– VirtualKeyboard.IsMinimize
– VirtualKeyboard.IsMaximize
– VirtualKeyboard.Handle
– VirtualKeyboard.Title [ := | –> ] cTitle
– VirtualKeyboard.Row [ := | –> ] nRow
– VirtualKeyboard.Col [ := | –> ] nCol
– VirtualKeyboard.Width [ := | –> ] nWidth
– VirtualKeyboard.Height [ := | –> ] nHeight
– VirtualKeyboard.FileName –> “OSK.EXE”
– VirtualKeyboard.FullFileName –> GetSystemDir()+”\OSK.EXE”
– Fixed Numeric Textbox bug –> http://hmgforum.com/viewtopic.php?p=34890#p34890
– Fixed bug in Grid control build in 64-bits –> http://hmgforum.com/viewtopic.php?p=34946#p34946
– Fixed bug in FocusedControl Property (reported by Tiampei)
– Fixed Windows problem of overlap between ToolBar Bottom and StatusBar
– HMG IDE
-Fixed when not found the text editor calls notepad.exe of windows (reported by Roberto Lopez)
-Updated Polish language in Unicode (contributed by Marek)
HMG.3.3.1 DOC.zip 2.02 MB
HMG.3.3.1 HARBOUR.zip 21.17 MB
HMG.3.3.1 hfcl.zip 85.50 KB
HMG.3.3.1 IDE.zip 1.75 MB
HMG.3.3.1 IDE_ANSI.zip 1.74 MB
HMG.3.3.1 INCLUDE.zip 207.78 KB
HMG.3.3.1 lib.zip 588.89 KB
HMG.3.3.1 MINGW.zip 80.84 MB
HMG.3.3.1 RESOURCES.zip 97.55 KB
HMG.3.3.1 SAMPLES.zip 9.99 MB
HMG.3.3.1 SOURCE.zip 697.39 KB
PSTABMENU() Short: ------ PSTABMENU() Popup tabular (grid style) )menu Returns: -------- <nSelection> => Number of menu option selected Syntax: ------- PSTABMENU(nTop,nLeft,nBottom,nRight,aPrompts,[cTitle],[nStart]) Description: ------------ Pops up a tabular (grid) menu based on an array of prompts passed as <aPrompts>. Dimensions of the menu table will be inside of the <nTop,nLeft,nBottom,nRight> dimensions for the popup box. Number of menu rows is the number of rows inside the box. Number of menu columns is determined based on number of rows. Prompts are layed out in a snaking fashion : e.g. (for a 3 row table...) column 1, row 1 = 1st prompt column 1, row 2 = 2nd prompt column 1, row 3 = 3rd prompt column 2, row 1 = 4th prompt Pressing a character will move to the next matching prompt with that first letter. Left-right and up-down perform a snaking pattern Pressing ENTER causes selection to be made, and the number of the selection to be returned. Pressing ESCAPE returns 0. [cTitle] is a itle for the popup box [nStart] is an optional starting option. Default is 1. Examples: --------- nChoice := pstabmenu(10,10,14,70,{"One","two","three","four",; "five","six","seven","eight",; "nine","ten","eleven","twelve"},"Select:") Source: ------- S_TABMEN.PRG
This is a mini application developed primarily to denote some wonderful features of HMG.
Mini Agenda uses:
– A text (csv) file for data source and Grid as browse of this file
– DEFINE ACTIVEX for “About” page from a .html file
– HFCL library ( Thanks to S. Rathinagiri for GridPrint )
Features :
– File operations: New, Open, ReOpen, Close, Save, Save as, Print
– Record operations: Append, Delete, Insert
– Three way ( Natural, Ascending, Descending) sorting columns
– Preserve current item after sort
– In_place editing
– Incremental (and “soft” ) Search
– .ini File for keeping record of last used data file
Download : source, executable.