AlignScreen

Procedure AlignScreen(J,K: INTEGER; VAR TopL,BotR : INTEGER);
VAR
	scnx1,scny1,scnx2,scny2,Width : INTEGER;
BEGIN
	GetScreen(scnx1,scny1,scnx2,scny2);
	Width:= K-J;
	TopL:= ((scnx1 + scnx2) DIV 2) - (Width DIV 2);
	BotR:= TopL + Width;
END;

What it does
Derives screen center coordinates. Use it with custom dialogs to center your dialog independently of screen size.


StdOKControl

Procedure StdOKControl(ScreenHt,ScreenWid:INTEGER);
BEGIN
	AddButton('OK',1,1,ScreenWid - 68,(ScreenHt-100)-33,ScreenWid -10,(ScreenHt-100)-13);
END;

What it does
Places the OK button in a standard dialog location. Use it in the creation of your custom dialogs.


StdControls

Procedure StdControls(ScreenHt,ScreenWid:INTEGER);
BEGIN
	AddButton('OK',1,1,ScreenWid - 68,(ScreenHt-100)-33,ScreenWid -10,(ScreenHt-100)-13);
	AddButton('Cancel',2,1,ScreenWid - 136,(ScreenHt-100)-33,ScreenWid -78,(ScreenHt-100)-13);
END;

What it does
Places the OK and Cancel buttons in a standard dialog location. Horizontal button orientation.




StdControls2

Procedure StdControls2(ScreenHt,ScreenWid:INTEGER);
BEGIN
	AddButton('OK',1,1,ScreenWid - 68,(ScreenHt-100)-63,ScreenWid -10,(ScreenHt-100)-43);
	AddButton('Cancel',2,1,ScreenWid - 68,(ScreenHt-100)-33,ScreenWid -10,(ScreenHt-100)-13);
END;

What it does
Places the OK and Cancel buttons in a standard dialog location. Vertical button orientation.




BoxToggle

Procedure BoxToggle(theItem:INTEGER);
BEGIN
	IF ItemSel(theItem) THEN 
		SetItem(theItem,False)
	ELSE 
		SetItem(theItem,True);
END;

What it does
Toggles check box on/off status in custom dialogs.




RadioToggle

Procedure RadioToggle(Control1,Control2,ItemSelected:INTEGER);
BEGIN
		IF ItemSelected = Control1 THEN BEGIN
			SetItem(Control1,True);
			SetItem(Control2,False);
		END
		ELSE IF ItemSelected = Control2 THEN BEGIN
			SetItem(Control1,False);
			SetItem(Control2,True);
		END;
END;

What it does
Toggles status of a radio button pair in custom dialogs.




RadioToggle3

Procedure RadioToggle3(Control1,Control2,Control3,ItemSelected:INTEGER);
BEGIN
		IF ItemSelected = Control1 THEN BEGIN
			SetItem(Control1,True);
			SetItem(Control2,False);
			SetItem(Control3,False);
		END
		ELSE IF ItemSelected = Control2 THEN BEGIN
			SetItem(Control1,False);
			SetItem(Control2,True);
			SetItem(Control3,False);
		END
		ELSE IF ItemSelected = Control3 THEN BEGIN
			SetItem(Control1,False);
			SetItem(Control2,False);
			SetItem(Control3,True);
		END;
END;

What it does
Toggles status of a 3 radio button set in custom dialogs.




RadioToggle4

Procedure RadioToggle4(Control1,Control2,Control3,Control4,ItemSelected:INTEGER);
BEGIN
		IF ItemSelected = Control1 THEN BEGIN
			SetItem(Control1,True);
			SetItem(Control2,False);
			SetItem(Control3,False);
			SetItem(Control4,False);
		END
		ELSE IF ItemSelected = Control2 THEN BEGIN
			SetItem(Control1,False);
			SetItem(Control2,True);
			SetItem(Control3,False);
			SetItem(Control4,False);
		END
		ELSE IF ItemSelected = Control3 THEN BEGIN
			SetItem(Control1,False);
			SetItem(Control2,False);
			SetItem(Control3,True);
			SetItem(Control4,False);
		END
		ELSE IF ItemSelected = Control4 THEN BEGIN
			SetItem(Control1,False);
			SetItem(Control2,False);
			SetItem(Control3,False);
			SetItem(Control4,True);
		END;
END;

What it does
Toggles status of a 4 radio button set in custom dialogs.




[Home][Previous][Next]