home *** CD-ROM | disk | FTP | other *** search
- program CacheDemo;
-
- uses
- OpCmd,
- OpString,
- OpCrt,
- OpFrame,
- OpWindow,
- OpPick,
- PkCache;
-
- var
- DemoPick : CachedPickList;
-
- {$F+}
- procedure DemoStrProc(Item : Word; Mode : pkMode; var IType : pkItemType; var IString : String; PickPtr : PickListPtr);
- begin
- {Simulate a slow device to obtain the pick string}
- FastWrite(Center('Item #'+Long2Str(Item)+' not in cache.', ScreenWidth), ScreenHeight, 1, 7);
- Sound(100);
- Delay(5);
- NoSound;
- Delay(150);
- FastFill(ScreenWidth, ' ', ScreenHeight, 1, 7);
-
- {Return the string}
- IString := 'This is a cache test #'+Pad(Long2Str(Item), 5);
- end;
- {$F-}
-
-
- begin
- TextAttr := 7; ClrScr;
- with DemoPick do
- begin
- InitCustom(28, 8, 54, 17, DefaultColorSet, wClear+wBordered,
- 27, 30, DemoStrProc, PickVertical, SingleChoice, 15);
- wFrame.AddHeader(' DEMO PICK CACHE ', heTC);
- repeat
- Process;
- if (GetLastCommand = ccSelect) then pkCache.FlushCache;
- until (GetLastCommand = ccQuit);
- Erase;
- Done;
- end;
- end.