Jump to content
Developer Wiki and Function Reference Links ×

Expand or Collapse Widget Group


Recommended Posts

Yes there is. The PIO must be event-enabled. I'm doing this in Python, but it should also work in Vectorscript.

In the Event 5 (kObjOnInitXProperties) routine, include these 3 lines:

 

Python:

_bResult = vs.SetObjPropVS(8, True)  # kObjXPropHasUIOverride
_bResult = vs.SetObjPropCharVS(81, vs.Chr(2))  # kWidgetGroupMode, kWidgetGroupAutomatic
object_info_palet(_sPIOName)

 

Vectorscript:

bResult = SetObjPropVS(8, TRUE);  {* kObjXPropHasUIOverride *}
bResult = SetObjPropCharVS(81, Chr(2));  {* kWidgetGroupMode, kWidgetGroupAutomatic *}
ObjectInfoPalet(sPIOName);

 

The last line calls these procedures. At least that's how I do it.

 

Python:

def object_info_palet(_sPIOName):
    _iPIOID = 100
    _iPIOID = insert_separator(_iPIOID, _sPIOName, "Global", 0)
    _iPIOID = insert_parameter(_iPIOID, _sPIOName, "LineLength", 1)
    _iPIOID = insert_parameter(_iPIOID, _sPIOName, "Diepte", 1)

def insert_separator(_iID, _sPIOName, _sParameter, _iIndent):
    _bResult, _sTmp = vs.GetLocalizedPluginParameter(_sPIOName, _sParameter)
    if _bResult:
        _bResult = vs.vsoAddWidget(_iID, 100, _sTmp)
        _bResult = vs.vsoAppendWidget(100, _iID, _sTmp, 0)
        vs.vsoWidgetSetIndLvl(_iID, _iIndent)
    return _iID+1

def insert_parameter(_iID, _sPIOName, _sParameter, _iIndent):
    _bResult, _sTmp = vs.GetLocalizedPluginParameter(_sPIOName, _sParameter)
    if _bResult:
        _bResult = vs.vsoAddParamWidget(_iID, _sParameter, "")
        _bResult = vs.vsoAppendParamWidget(_iID, _sTmp, 0)
        vs.vsoWidgetSetIndLvl(_iID, _iIndent)
    return _iID+1

 

 

 

Vectorscript:

PROCEDURE ObjectInfoPalet;

VAR
	iPIOID: INTEGER;
BEGIN
    iPIOID := 100;
    iPIOID := InsertSeparator(iPIOID, sPIOName, 'Global', 0);
    iPIOID := InsertParameter(iPIOID, sPIOName, 'LineLength', 1);
    iPIOID := InsertParameter(iPIOID, sPIOName, 'Depth', 1);
    ...
END;

FUNCTION InsertSeparator(iID: INTEGER; sPIO, sField: STRING; iIndent: INTEGER): INTEGER;
VAR
    bResult: BOOLEAN;
    sTmp: STRING;
BEGIN
    bResult := GetLocalizedPluginParameter(sPIO, sField, sTmp);
    IF bResult
    THEN BEGIN
        bResult := vsoAddWidget(iID, 100, sTmp);
        bResult := vsoAppendWidget(100, iID, sTmp, 0);
        vsoWidgetSetIndLvl(iID, iIndent)
    END;
    InsertSeparator := iID + 1;
END;

FUNCTION InsertParameter(iID: INTEGER; sPIO, sField: STRING; iIndent: INTEGER): INTEGER;
VAR
    bResult: BOOLEAN;
    sTmp: STRING;
BEGIN
    bResult := GetLocalizedPluginParameter(sPIO, sField, sTmp);
    IF bResult
    THEN BEGIN
        bResult := vsoAddParamWidget(iID, sField, '');
        bResult := vsoAppendParamWidget(iID, sTmp, 0);
        vsoWidgetSetIndLvl(iID, iIndent);
    END;
    InsertParameter := iID + 1;
END;

 

I hope the Vectorscript is correct, I do more Python these days.

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...