BEGIN external class windowtools; SimpleWindow CLASS MySimpleWindow; BEGIN REF(Button) Quit,b1,b2,b3,b4,b5,b6,b7,b8,b9; character etape; INTEGER cycle; PROCEDURE MESSAGE(t); TEXT t; BEGIN Clear; DrawCenterText(t); END; PROCEDURE PerformIn(t,b); TEXT t; REF(SubWindow) b; BEGIN Message("Appuye sur " & t); b.SetFont("-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1"); END; PROCEDURE ClickInButton(b); REF(Button) b; BEGIN IF b==b1 then BEGIN IF etape <> 'z' then etape := Char(Rank(etape)+1) ELSE etape :='a'; b1.SetShortCut(etape); b1.SetHeading("Short Key " & char_as_text(etape)); b1.Resize; END ELSE IF b==b2 THEN BEGIN b2.SetActive; DisallowButtonsInWindow; b2.Wait; AllowButtonsInWindow; b2.SetInactive; END; IF b==b5 THEN BEGIN b3.Invert; b4.Invert; END; IF b==b6 THEN BEGIN b6.SetActiveDisallow; b6.Wait; b6.SetInactiveAllow END; IF b==b8 THEN BEGIN b7.SetHeading(IF cycle = 0 THEN b1.current_heading ELSE IF cycle = 1 THEN b1.window_kind ELSE b1.heading_and_key); b7.Resize; cycle := cycle +1; IF cycle = 3 THEN cycle :=0; END; IF b==b7 THEN b1.Click; IF b==Quit AND Quit.IsWaiting THEN BEGIN Quit.Clear; b9 :- MakeButton("Quit"); b9.PlaceBelow(b1); END; END; etape := 'a'; cycle := 0; END class SimpleWindow; INSPECT NEW MySimpleWindow("Main") DO BEGIN Quit :- MakeButton("QUIT"); b1 :- MakeButton("Short Key").PlaceBelow(Quit); b2 :- MakeButton("Block").PlaceRightOf(Quit); b5 :- MakeButton("Inverse"); b3 :- new FancyButton(THIS XWindow,"Fancy Button").PlaceBelow(b5).show; b4 :- NEW Button(THIS XWindow,"Normal Button").PlaceBelow(b3).show; b6 :- MakeButton("Block #2"); b7 :- MakeButton("Twin"); b8 :- MakeButton("Change Twin").PlaceBelow(b7); Quit.Wait; WHILE ButtonChoice <> "Quit" DO ; END; END