VS:CreateControl/ja

From Vectorworks Developer
Jump to navigation Jump to search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

イメージ、カラーパレット、スライダーなどのアイテムを作成します。

PROCEDURE CreateControl(
dialogID :LONGINT;
itemID :LONGINT;
controlKind :LONGINT;
name :STRING;
data :LONGINT);
def vs.CreateControl(dialogID, itemID, controlKind, name, data):
    return None

Parameters

dialogID LONGINT ダイアログ番号
itemID LONGINT アイテム番号
controlKind LONGINT アイテムの種類
name STRING アイテムの文字列
data LONGINT アイテムのデータ

Example

{open the resource file containing the graphics for the dialog}
rsAvailable:= SetVSResourceFile('Images');
{creates a new image control}
 CreateControl(lEditID,5,1,'SplashImage',1010);

{Slider Control Example}
PROCEDURE dialog1_Main;
CONST
	kSlider = 4;
	kLabel  = 5;
	kValue  = 6;
VAR
	dialog1   :INTEGER;
	gSlider   :LONGINT;

PROCEDURE dialog1_Handler(VAR item :LONGINT; data :LONGINT);
BEGIN
	CASE item OF
		kSlider:
			BEGIN
				GetControlData(dialog1, kSlider, gSlider);
				SetField(kValue, Concat(gSlider));
			END;
	END;
END;

BEGIN
	gSlider := 1000;
	dialog1 := CreateLayout('Slider Control', False, 'OK', 'Cancel');
	CreateControl     (dialog1, kSlider,  3, '', 1000);
	CreateStaticText  (dialog1, kLabel,   'Slider Value:', -1);
	CreateStaticText  (dialog1, kValue,   ' ', -1);
	SetFirstLayoutItem(dialog1, kSlider);
	SetBelowItem      (dialog1, kSlider,  kLabel,   0, 0);
	SetRightItem      (dialog1, kLabel,   kValue,   0, 0);
	IF RunLayoutDialog(dialog1, dialog1_Handler) = 1 THEN BEGIN
	END;
END;
RUN(dialog1_Main);

Version

利用可能バージョン: VectorWorks9.0