VS:vsoInsertWidget: Difference between revisions
(Updated Widget List) |
(fix old link to vectorlab) |
||
(One intermediate revision by one other user not shown) | |||
Line 5: | Line 5: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<desc> | <desc> | ||
This function inserts a widget into the ObjectInfoPalette. It allows the user to define the location of where this widget will be in the OIP widget list. | |||
WidgetTypes: | WidgetTypes: | ||
Line 36: | Line 36: | ||
</code> | </code> | ||
See | See [[VS:Object Events]]. | ||
</desc> | </desc> | ||
Line 56: | Line 56: | ||
paramID | paramID | ||
LONGINT | LONGINT | ||
The ID and location of where this widget will be displayed in the OIP. | |||
</line> | </line> | ||
<line> | <line> | ||
widgetType | widgetType | ||
LONGINT | LONGINT | ||
Type of widget to create. | |||
</line> | </line> | ||
<line> | <line> | ||
mappingID | mappingID | ||
LONGINT | LONGINT | ||
Ordinal value of object parameter that corresponds to this widget. | |||
</line> | </line> | ||
<line> | <line> | ||
text | text | ||
STRING | STRING | ||
The label to be displayed on OIP for this widget. | |||
</line> | </line> | ||
<line> | <line> | ||
data | data | ||
LONGINT | LONGINT | ||
Not implemented yet. | |||
</line> | </line> | ||
</lineList> | </lineList> | ||
Line 88: | Line 88: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark> | ||
At least in 2008, there might be a bug in this call. The "mappingID" argument doesn't seem to be registering the index of the widget properly, and as a result, if the widget is a button, you won't get the proper index in the button click event. | |||
If somebody fully investigates this, and determines that it's a bug, he/she should enter a bug report. | |||
At least in 2008, there might be a bug in this call. The "mappingID" argument doesn't seem to be registering the index of the widget properly, and as a result, if the widget is a button, you won't get the proper index in the button click event. If somebody fully investigates this, and determines that it's a bug, he/she should enter a bug report. | |||
vsoAppendWidget still works OK. | vsoAppendWidget still works OK. | ||
Line 111: | Line 104: | ||
==== VectorScript ==== | ==== VectorScript ==== | ||
<code lang="pas"> | <code lang="pas"> | ||
kOnInitPropertiesEventID: | |||
BEGIN | BEGIN | ||
resultStatus := SetObjPropVS(kObjectHasUIOverrideID, TRUE); | resultStatus := SetObjPropVS(kObjectHasUIOverrideID, TRUE); | ||
Line 119: | Line 112: | ||
resultStatus := vsoInsertParamWidget(4,4, 'Previous static text', 0); | resultStatus := vsoInsertParamWidget(4,4, 'Previous static text', 0); | ||
resultStatus := vsoInsertWidget(5,kWidgetButton, 5,'Update Text', 0); | resultStatus := vsoInsertWidget(5,kWidgetButton, 5,'Update Text', 0); | ||
END; | END;</code> | ||
==== Python ==== | ==== Python ==== | ||
<code lang="py"> | <code lang="py"> |
Latest revision as of 17:51, 13 May 2021
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
This function inserts a widget into the ObjectInfoPalette. It allows the user to define the location of where this widget will be in the OIP widget list.
WidgetTypes:
kFieldLongInt = 1; kFieldBoolean = 2; kFieldReal = 3; kFieldText = 4; kFieldCalculation = 5; kFieldHandle = 6; kFieldCoordDisp = 7; {dimension} kFieldPopUp = 8; kFieldRadio = 9; kFieldCoordLocX = 10; kFieldCoordLocY = 11; kWidgetButton = 12; kWidgetStaticText = 13; kFieldStaticText = 14; kWidgetDimStdPopUp = 16; kWidgetPrecisionPopUp = 17; kWidgetClassesPopup = 18; kWidgetLayersPopup = 19; kWidgetAngleDisp = 20; kWidgetAreaDisp = 21; kWidgetVolumeDisp = 22; kWidgetSeparator = 100; kWidgetSubSelection = 101; kWidgetBoundPopup = 102; kWidgetBoundOffset = 103;
See VS:Object Events.
FUNCTION vsoInsertWidget(
paramID :LONGINT;
widgetType :LONGINT;
mappingID :LONGINT;
text :STRING;
data :LONGINT) :BOOLEAN;
def vs.vsoInsertWidget(paramID, widgetType, mappingID, text, data): return BOOLEAN
Parameters
paramID LONGINT The ID and location of where this widget will be displayed in the OIP. widgetType LONGINT Type of widget to create. mappingID LONGINT Ordinal value of object parameter that corresponds to this widget. text STRING The label to be displayed on OIP for this widget. data LONGINT Not implemented yet.
Remarks
At least in 2008, there might be a bug in this call. The "mappingID" argument doesn't seem to be registering the index of the widget properly, and as a result, if the widget is a button, you won't get the proper index in the button click event.
If somebody fully investigates this, and determines that it's a bug, he/she should enter a bug report.
vsoAppendWidget still works OK.
It looks like the problem occurs if you don't declare kObjXPropHasUIOverride (kObjXPropHasUIOverride is FALSE or not declared):
result := SetObjPropVS(kObjXPropHasUIOverride, TRUE);
Example
VectorScript
kOnInitPropertiesEventID: BEGIN resultStatus := SetObjPropVS(kObjectHasUIOverrideID, TRUE); resultStatus := vsoInsertParamWidget(1,1, 'Unused number', 0); resultStatus := vsoInsertParamWidget(2,2, 'Static Text Widget', 0); resultStatus := vsoInsertParamWidget(3,3, 'Enter junk here', 0); resultStatus := vsoInsertParamWidget(4,4, 'Previous static text', 0); resultStatus := vsoInsertWidget(5,kWidgetButton, 5,'Update Text', 0); END;
Python
Version
Availability: from All Versions
This is drop-in function.