Harbour MiniGUI Extended Edition
Getting Started
Download and install
To install and use MiniGUI, you will need:
- MiniGUI source and binaries
- Harbour or xHarbour compiler
- Borland C++ compiler (version 5.5.1), or MinGW (since version 4.4), or Open Watcom (version 1.9), or Pelles C compiler
MiniGUI uses Harbour and Borland C++ by default. To use MiniGUI with Harbour and Borland C++, go to the Download page and download the first two files. Harbour binaries are included in the first file. Run the installation in both of these files.
The first installation file installs MiniGUI and Harbour, and the second
installation file installs Borland C++. The default location for MiniGUI is
C:\MiniGUI
, and for Borland C++ it is
C:\Borland\BCC55
. The configuration directions below assume you
have installed to these locations. Be sure to adjust your configuration to
reflect your installation.
You may also use xHarbour instead of Harbour. While Harbour binaries are
included in MiniGUI, xHarbour binaries are not. If you use xHarbour, you must
download and install it separately. You must also build MiniGUI’s
libraries with xHarbour, as explained below. The configuration directions
below assume you install it to the default location of
C:\xHarbour
.
Configure
1. Edit or create C:\Borland\BCC55\Bin\bcc32.cfg
and include
the following lines:
-I"c:\Borland\Bcc55\include" -L"c:\Borland\Bcc55\lib;c:\Borland\Bcc55\lib\psdk"
If you are using xHarbour, use the following lines instead:
-I"c:\Borland\Bcc55\include;c:\xharbour\include" -L"c:\Borland\Bcc55\lib;c:\Borland\Bcc55\lib\psdk;c:\xharbour\lib"
2. Edit (or create) C:\Borland\BCC55\Bin\ilink32.cfg
and
include the following line:
-L"c:\Borland\Bcc55\lib;c:\Borland\Bcc55\lib\psdk"
If you are using xHarbour, use the following line instead:
-L"c:\Borland\Bcc55\lib;c:\Borland\Bcc55\lib\psdk;c:\xharbour\lib"
3. Set environmental variables in your AUTOEXEC.NT
:
-
If you did not install Borland C++ to
C:\Borland\BCC55
, add the lineSET MG_BCC=
<location of Borland C++> to yourAUTOEXEC.NT
. -
If you did not install MiniGUI to
C:\MiniGUI
, add the lineSET MG_ROOT=
<location of MiniGUI>. -
Harbour is included in MiniGUI at
%MG_ROOT%\Harbour
, which defaults toC:\MiniGUI\Harbour
. To use Harbour in some other location, add the lineSET MG_HRB=
<location of Harbour>. -
MiniGUI libraries compiled for Harbour are included in MiniGUI at
%MG_ROOT%\Lib
, which defaults toC:\MiniGUI\Lib
. To use MiniGUI libraries for Harbour in some other location, add the lineSET MG_LIB=
<location of MiniGUI libraries for Harbour>.
If you are using xHarbour:
-
Add
SET MG_CMP=XHARBOUR
to yourAUTOEXEC.NT
. -
The default location for xHarbour is
C:\xHarbour
. To use xHarbour in a different location, add the lineSET MG_XHRB=
<location of xHarbour>. -
The default location for MiniGUI libraries compiled for xHarbour is
%MG_ROOT%\xLib
, which defaults toC:\MiniGUI\xLib
. To use MiniGUI libraries for xHarbour in some other location, add the lineSET MG_XLIB=
<location of MiniGUI libraries for xHarbour>. -
Build MiniGUI libraries: Go to the
\SOURCE
directory within MiniGUI and runMakeAllMiniguiLibs.bat
.
Your First MiniGUI Program
At this point, you should be ready for your first MiniGUI program.
We will start with a program, hello.prg
, that displays a
“Hello World” window.
#include "minigui.ch" PROCEDURE Main DEFINE WINDOW Win_1 ; AT 0,0 ; WIDTH 400 ; HEIGHT 200 ; TITLE 'Hello World!' ; MAIN END WINDOW ACTIVATE WINDOW Win_1 RETURN
In the above code:
-
DEFINE WINDOW
command creates the window. -
Win_1
is the name of the window. -
AT 0,0
indicates the window position (row 0, col 0). -
WIDTH 400
means that the window will be 400 pixels wide. -
HEIGHT 200
means that the window will be 200 pixels high. -
TITLE 'Hello World!'
indicates the text in the window title bar. -
MAIN
indicates that we are defining the main application window. -
ACTIVATE WINDOW Form_1
shows the window and starts the event loop.
To compile and run this program, put it into hello.prg
and
use MiniGUI’s standard tool Compile.bat
by typing
c:\minigui\batch\compile.bat hello
Other development tools are described below.
Semi-OOP syntax
In the example above, to retrieve the window title, use the command:
cVar := Win_1.Title
and to change the window title, use the following:
Win_1.Title := 'New Title'
More samples
The above hello world program is in the MiniGUI samples at
\SAMPLES\BASIC\HELLO_WORLD
. The \SAMPLES
directory
contains hundreds of other working MiniGUI applications.
Many more samples, documents, libraries, utilities, and tools are in the MiniGUI user group upload center at http://groups.yahoo.com/group/harbourminigui/files/.
Development tools
MiniGUI includes the following development tools.
Compile.bat, located in \BATCH
and briefly mentioned
above, is a command line tool for building an executable from one or more
source files. Type compile.bat /?
for help text.
MPM (MiniGUI Project Manager), located in \UTILS\MPM
,
is a GUI tool for building an executable from one or more source files. MPM
stores the specs for each executable in a project file with an
.mpm
extension. Before using MPM, use the
Compile.bat
in the MPM directory to build the MPM executable.
Within MPM, use Tools | Environment to associate .prg
and
.mpm
files with MPM and set the locations of BCC, Harbour, and
MiniGUI.
The MiniGUI IDE (integrated development environment), located in
\IDE
, is a GUI tool for visual form editing and
application building. Within the IDE, use Tools | Preferences to set
the locations of BCC, Harbour, and MiniGUI and make other settings.
Support
For questions or suggestions about MiniGUI or Harbour, see Support.