{ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
 Ί                              EXAMPLE SOURCE                               Ί
 ΜΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΉ
 Ί                  To be used with MOS v3.0 Professional GUI                Ί
 ΜΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΉ
 Ί Coded by Zuul as BouFFtou as Cheveau Fr‚d‚ric.                            Ί
 Ί Source Turbo Pascal v7.00 generated by MRE (MOS Resource Editor) v2.8.    Ί
 Ί Contact us on MOS Home's Page - http://www.multimania.com/mos             Ί
 ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ}

{$M 65500,0,365520}                     {*Stack And Heap*}

Program Window;                         {*Program Name*}

Uses Dos,                               {*Unit BP7 DOS*}
     MOS_VESA,MOS_DEB,                  {*Manage VESA and debug*}
     MOS_STR, MOS_BLK,                  {*Manage Strings and blankers*}
     MOS_CRT, MOS_BAS,                  {*Manage Initialisations and CRT*}
     MOS_ASM, MOS_MSE,                  {*Manage Assembler and Mouse*}
     MOS_IPX, MOS_XMS,                  {*Manage Networks and XMS Memory*}
     MOS_TOO, MOS_GAD,                  {*Manage Tools and Gadgets*}
     MOS_GFX, MOS_BMP,                  {*Manage Graphics and BMP*}
     MOS_WIN, MOS_MEN,                  {*Manage Windows and Menus*}
     MOS_WAV, MOS_VAR,                  {*Manage WAV Sounds*}
     MOS_DIR, MOS_SYS,                  {*Manage Disk and System*}
     MOS_TSK, MOS_LIS,                  {*Manage Tasks and Lists*}
     MOS_EZR, MOS_GPH,                  {*Manage Dialogs and Graph*}
     MOS_KBD, MOS_DSK,                  {*Manage Keyboard and Disk*}
     MOS_REQ, MOS_SWAP;                 {*Manage Requesters and Swap Disk*}

{ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
 Ί                             PROCEDURE Main                                Ί
 ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ}

Procedure Main(Px,Py:Integer);
Var W1            :TWindow;             {*Window Structure*}
    Even          :Byte;                {*Get Windows Evens*}
    XOk,XCancel   :Boolean;             {*Exit Flags*}

{************************* DISPLAY WINDOW CONTENT ***************************}

Procedure REDRAW_FRAME;                 {*Define Window Content*}
Begin
Win_Clip(On,W1);                        {*Clipping Window*}

{*Declare here your gadgets...*}

Win_Clip(Off,W1);                       {*Restore Normal Clipping*}
End;

{***************************** MAIN PROCEDURE *******************************}

Begin
Win_Init(Px,Py,Px+LaF*80,Py+HaF1+HaF*25,$51FF,'MY WINDOW',W1);
Win_Sup(100,50,250,200,79,60,639,479,0,5,$0A10,W1);{*Supplement*}
If NError<>0 Then Exit;                 {*Initialisations Errors ?*}
Win_Draw(W1);                           {*Display Window*}

REDRAW_FRAME;                           {*Display Window Content*}
XOk:=No; XCancel:=No;                   {*Init Exit Flags*}

Repeat;
If Win_Ready(W1) Then                   {*Test if Window Ready*}
   Begin                                {*Test Personnals Gadgets*}
   Win_Clip(On,W1);                     {*Clipping Window*}

{*Insert here your gadgets tests...*}

   Win_Clip(Off,W1);                    {*Restore Normal Clipping*}
   End;

Even:=Win_Test(W1);                     {*Get Windows Evens*}
If Even=1 Then XCancel:=Yes;            {*Window Closed   => Exit*}
If Even=3 Then REDRAW_FRAME;            {*Window Extended => Display Content*}
If Even=4 Then REDRAW_FRAME;            {*Window Resized  => Display Content*}
If Even=9 Then REDRAW_FRAME;            {*Window Moved    => Display Content*}
Until (XOk) Or (XCancel);               {*Exit Flags*}

Win_Kill(W1);                           {*Close Window if Needs*}
End;

{ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
 Ί                        MAIN PROGRAM (INITIALISATIONS)                     Ί
 ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ}

Begin
INIT_BASE;                               {*Initialise Hardware*}
INIT_SCREEN;                            {*Initialise Screen*}
INIT_MOUSE;                             {*Initialise Mouse*}

Oldexit:=ExitProc;                      {*Intercept Errors*}
SetJump(MyAddr);
ExitProc:=@ENTRY_INT24;

Main(100,100);

DONE_MOUSE;                             {*Restore Mouse*}
DONE_SCREEN;                            {*Restore Screen*}
DONE_BASE;                               {*Restore Hardware*}
End.
