Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FiveWin 1.9.2 - January 97 - <b>xbase common elements</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 xBase common elements
--------------------------------------------------------------------------------

 We have paid particular attention into the syntax of FiveWin such as using
 the same clause to do the same thing in similar circumstances. This means
 that as soon as you learn these few rules, you may control a lot of
 different FiveWin features.

 We will keep extending this basic concept to manage all the different parts
 of the Windows API. Having just a unique xBase interface to manage the
 Windows API will let you concentrate in the goal of your application and
 not in the details.

 xBase clauses                  Description
--------------------------------------------------------------------------------

  DEFINE              All the objects in FiveWin get created using the
                      key word DEFINE:

                      DEFINE <Class> <Object> [<more clauses>]

                      As example, to create a window we do:

                      DEFINE WINDOW oWnd ...

                      To create a Dialog Box:  DEFINE DIALOG oDlg ...
                      To create an icon:       DEFINE ICON oIco ...
                      To create a report:      DEFINE REPORT oRpt ...

                      Remember to use DEFINE to create anything!

  ACTIVATE            Everything in FiveWin start working using the
                      key ACTIVATE:

                      ACTIVATE <Class> <Object> [<more clauses>]

                      As example, to activate a window we do:

                      ACTIVATE WINDOW oWnd ...

                      To activate a Dialog Box: ACTIVATE DIALOG oDlg ...
                      To activate a report:     ACTIVATE REPORT oRpt ...
                      To activate a timer:      ACTIVATE TIMER  oTmr ...

                      Remember to use ACTIVATE to make things work!


  :End()              Though this is an OOPS message, we use it extensively
                      in FiveWin to end the execution of something:

                      <Object>:End()

                      As example, to end the execution of a window we use:

                      oWnd:End()

                      To end a Dialog Box:  oDlg:End()
                      To end a report:      oRpt:End()
                      To end a timer:       oTmr:End()

                      We use the OOPS message instead of a xBase command,
                      because we may issue it from many different places,
                      where it is not possible to use an xBase command:

                      REDEFINE BUTTON ID ID_END OF oDlg ;
                         ACTION oDlg:End()


  OF                  Every time we need to specify the owner or
                      container of an Object, we use OF:

                      REDEFINE BUTTON ID ID_OK OF oDlg

                      The clause OF means: "belongs to", "it is contained
                      in", "its owner is".

                      For example, to specify the owner of a DialogBox:

                      DEFINE DIALOG oDlg RESOURCE "Test" OF oWnd

                      For a child window: DEFINE WINDOW oWnd2 TITLE "Test" ;
                                             OF oWnd1

                      For a control:  REDEFINE GET cName ID ID_NAME OF oDlg
                      For a font:     DEFINE FONT oFont NAME "Arial" ;
                                         SIZE 0, -20 OF oPrn


  RESOURCE            You may use any of these clauses to specify
  RESNAME             that an Object has to be built from resources.
  NAME
                      DEFINE ... RESOURCE <cResourceName>

                      For example, to create an icon from resources, we do:

                      DEFINE ICON oIco RESOURCE "MyIcon"

                      To create a Dialog Box:

                      DEFINE DIALOG oDlg RESOURCE "Clients"

                      To create a cursor:

                      DEFINE CURSOR oCrs RESOURCE "Eye"

                      Remember: Always use RESOURCE clause to create
                      an Object from resources stored inside the same
                      EXE (rc resources) or stored inside a DLL.


  FILENAME            You may use any of these clauses to specify
  FILE                than an Object has to be loaded from a file in disk.
  DISK
                      DEFINE ... FILENAME <cFileName>

                      For example to use a button bitmap which picture
                      is inside a BMP file we do:

                      DEFINE BUTTON OF oBar FILENAME "Exit.bmp"

                      To create a bitmap control from disk we do:

                      REDEFINE BITMAP oBmp ID ID_PHOTO OF oDlg ;
                         FILENAME "Photo.bmp"

                      Remember: Always use FILENAME clause to use
                      a file stored at disk.


  SIZE <nWidth>,      Every time we have to specify some pixel dimensions
       <nHeight>      we use the SIZE clause.

                      Remember: Always use SIZE to specify certain dimensions.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson