|
/* $VER: DemoStringCursor 1.0 (17.7.2007)
*/
App.Description='Demo'
App.Copyright ='© 2007 by Robert A. Sisk'
App.Title=word(SourceLine(1),3)
App.Base=App.Title
call AddLib 'rmh.library',0,-30
call RMH_MacroEnv 'MacroEnv','ProgDir CD'
if RMH_AddLibrary('rexxsupport.library','rxmui.library')>0 then do
call RMH_EasyRequest "Can't open" result,App.Title,'Exit'
signal Exit
end
App.Author=SubWord(App.Copyright,find(App.Copyright,'by')+1)
App.SingleTask=1
App.Version=SubWord(SourceLine(1),2)
App.SubWindow='MainWindow'
MainWindow.ID='Main'
MainWindow.Title=App.Title
String.CycleChain=1
String.RemainActive=1
FlashWords.CycleChain=1
MainWindow.Contents=MakeObj(,'VGroup',,
MakeObj(,'HGroup',label('_String'),string('String','s','Here are some words
to flash.')),,
MakeObj(,'HCenter',button('FlashWords','_Flash Words')))
call NewObj 'Application','App'
SigBreakB_Ctrl_C=12
BreakCSignal=2**SigBreakB_Ctrl_C
call notify 'MainWindow','CloseRequest',1,'App','ReturnID','Quit'
call notify 'FlashWords','Pressed',0,'App','ReturnID'
call set 'MainWindow','Open',1
if ~xGet('App','Iconified') then
if ~xGet('MainWindow','Open') then do
call MUIRequest 'App',,App.Title,'_Exit',"Can't open main window"
signal Exit
end
do forever
call NewHandle 'App','Event',BreakCSignal
if RMH_And(Event.Signals,BreakCSignal)>0 then
call Quit
interpret 'call' Event.Event
end
Quit:
Exit:
exit
FlashWords:
string=xGet('String','Contents')
call set 'String','Quiet',1
do word=1 for words(string)
wordStart=WordIndex(string,word)-1
call set 'String','MarkStart',wordStart
call set 'String','MarkEnd',wordStart+WordLength(string,word)-1
call delay 25
end
call set 'String','MarkEnd','NoMark'
call set 'String','Quiet',0
return
|