*/
Stuck? Need help? Ask questions on our forums.
*/

View \PULLWORK.PAS

PULL Multi-level Pull-Down Menus v7.0b

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


{ ========================================================================== }
{ Pullwork.pas - Work Window procedures for main work     var 7.0b, 09-24-93 }
{                area for PULLDEMO.PAS                                       }
{ This file contains all the procedures executed for the Work Window.  These }
{ are the main steps of your program.  With this, you can create a sophisti- }
{ cated multi-level window environment.                                      }
{   Copyright (c) 1988,1993 James H. LeMay, All rights reserved.             }
{ ========================================================================== }

{$i pulldefs.inc }

UNIT PullWork;

INTERFACE

procedure WorkWndw;


IMPLEMENTATION

uses
  Crt,Qwik,Wndw,Pull,PullStat
  {$ifdef UseDataEntryCode }
  ,PullData;
  {$else }
  ;
  {$endif }

{ ========================= Work Window Steps ============================== }
{ This procedure will have all the procedures for the Work window(s).        }
{ Each step assumes that some keystroke has been pressed and returns a value }
{ for Key and ExtKey and any necessary change to WorkWndwStep.               }
{ -------------------------------------------------------------------------- }
var
  Start1,Start2: word;

{$ifdef MultiWorkWndws }
procedure ResetWorkWndwStep;
begin
  case TWS.WSname of
    Window1:  WorkWndwStep := 1;
    Window2:  WorkWndwStep := 3;
  end;
end;

procedure HideWorkWndw;
begin
  HideWindow;
  TopWorkWndwName := TWS.WSname;
  ResetWorkWndwStep;
end;

procedure AccessWorkWndw (WN: WindowNames);
begin
  if WN<>TWS.WSname then
    begin
      { -- if accessing a PermMode window, hide all upper windows. -- }
      if (GetLevelIndex(WN)<=PLI) then
        while (LI>PLI) do
          HideWindow;         { Use RemoveWindow for serial access }
      AccessWindow (WN);
      ResetWorkWndwStep;
    end;
end;
{$endif }

procedure KbdIdle; far;
begin
  { Nothing to include this time, but fill in what you want to do while }
  { the keyboard is idle. }
end;

procedure ShowFields;
begin
  WWrite (14,10,'Byte:');
  WWrite (15,10,'Word:');
  WWrite (16,10,'ShortInt:');
  WWrite (17,10,'Integer:');
  WWrite (18,10,'LongInt:');
  WWrite (19,10,'Real:');
  WWrite (14,39,'Hex:');
  WWrite (15,39,'Char:');
  WWrite (16,39,'String:');
  WWrite (17,39,'File name:');
  DisplayFields (ord(aByte2DE),ord(FileNameDE));
end;

procedure MakeWorkWndw2;
begin
  SetWindowModes (HiddenMode);
  MakeWindow ( 8,21,10,40,LightBlue+LightGrayBG,LightBlue+LightGrayBG,
               DoubleBrdr,Window2);
  SetWindowModes (0);
  WriteToHidden (Window2);
  TitleWindow (Top   ,Left  ,SameAttr,'2');
  TitleWindow (Top   ,Center,SameAttr,' Work Window 2 ');
  TitleWindow (Bottom,Center,SameAttr,' Press ESC to Hide ');
  WWriteC (1,'Type in any input');
  WGotoRC (2,1);
  WriteToCRT;
end;

procedure EditFields;
begin
  { Only FileName may have been changed }
  DisplayFields (ord(FileNameDE),ord(FileNameDE));
  EnterSeq (ord(aByte2DE),ord(FileNameDE),Start1);
end;

procedure InitWorkWndws;
begin
  ShowFields;
  WorkWndwStep := 1;
  Key := NullKey;  { #00 }
end;

procedure WorkWndw;
begin
  {$ifdef MultiWorkWndws }
  AccessWorkWndw (TopWorkWndwName);
  {$endif }
  case WorkWndwStep of
    0:  InitWorkWndws;
    1:  EditFields;
  end;
end;

BEGIN
  WorkWndwStep := 0;          { Initial step for work windows. }
  {$ifdef MultiWorkWndws }
  TopWorkWndwName := Window1;
  {$endif }
  Start1 := ord(aByte2DE);
  Start2 := ord(aHex2DE);
  CallWorkWndw := WorkWndw;
  CallKbdIdle  := KbdIdle;
END.

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.