User Tag List

Results 1 to 9 of 9

Thread: about the PARAM_POSITION Dialog

  1. #1
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    prester's Avatar
    Join Date
    Feb 2010
    Location
    japan
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question about the PARAM_POSITION Dialog

    I am missing How to activate and get a layer number of in the PARAM_POSITION Dialog. (Especially to know how to activate the layer setting)

    Click image for larger version. 

Name:	Clipboard01.gif 
Views:	52 
Size:	71.9 KB 
ID:	31771

    Currently The positions data recived as a integer, if include the layer info in it, to use the user defined struct?

    paramExt* getxyl = (paramExt*)CNC_GetParameter(rdPtr);
    xylParam* xyl = (xylParam*)getxyl->pextData;// custom struct
    int xpos = HIWORD(xyl.layer);
    int ypos = LOWORD(xyl.layer);
    int layer = xyl.layer;

    have any info?

  2. #2
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    581
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Cast the long value you get to LPPOS.
    You can find the definition in cncf.h.
    Usually directly cast is enough, but for some cases (e.g., obstacle type) you need to get the value by cast param to eventParam struct and get the value in W or L, according to Yves's comment.

  3. #3
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    581
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Edit: if your extension uses more than two params, then cast param1 or 2 is not enough, in this case you need to get the currentParam pointer.
    The macro provided to read params will update this pointer, so be careful to not mess the order.

    Code:
    eventParam* param = rdPtr->rHo.hoCurrentParam;
    param = (eventParam*)((BYTE*)(param) + param->evpSize * index);

  4. #4
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,640
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    This is possible for absolute positions only. Before doing CNC_GetParameter, do this:

    LPPOS pPos = (LPPOS)&rdPtr->rHo.hoCurrentParam->evp.evpW.evpW0;

    This gives you access to the PositionParam structure. In this structure, posLayer gives you the layer, but only if it's an absolute position, = when posOINUMParent == -1.

    If posOINUMParent != -1, then you have to take the layer from the "parent" object. Finding what is the parent object depends on the current selection, this is complex and this function is not available to extensions.

  5. #5
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    prester's Avatar
    Join Date
    Feb 2010
    Location
    japan
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks for replies, defisym and Yves.

    Yves saying what If posOINUMParent == -1, But i'm not know about what the case of posOINUMParent will get the value -1.

    In most cases, from the Extensions, Not be able to access the pulldown menu of the layer when to use the PARAM_POSITION Dialog?

  6. #6
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    581
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by prester View Post
    Yves saying what If posOINUMParent == -1, But i'm not know about what the case of posOINUMParent will get the value -1.
    When using actual instead of relative to…
    Actually you can get parent object’s pointer, but a bit complex: get oil offset by oi then access to this object’s objectInfoList, and you can get first selection & offset to next, then you can iterate it as a chained list. Also you need to handle the case the object you relative to is a qualifier, method is the same but first you need to use a qualifier to object list to get the object info list with this qualifier, and call the iterate function of single object.
    You can find an object selection helper class by Anders Riggelsen (Andos) on forum, which helps a lot for beginners. I wrote a custom version based on it with the help of uppernate here: https://github.com/defisym/OpenFusio...ectSelection.h
    Playing with selection is a inevitable part of fusion, enjoy :p

  7. #7
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    prester's Avatar
    Join Date
    Feb 2010
    Location
    japan
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If not using Relative, is it possible to way to get the layer param from pulldown in the PARAM_POSITION Dialog?

    I found an exsample in Andos's opensource "Create By Name object".
    It was using PARAM_POSITION Dialog, but this extension get XY pos only from Dialog and to get a layer info from the another param.

    Click image for larger version. 

Name:	PARAM_POSITION_absolute_pos_and_Pulldown_Layer.gif 
Views:	32 
Size:	80.3 KB 
ID:	31775

  8. #8
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,640
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    Did you try what I said above?

    Before doing CNC_GetParameter, do this:

    LPPOS pPos = (LPPOS)&rdPtr->rHo.hoCurrentParam->evp.evpW.evpW0;

    If the user chose "Actual coordinates", then posOINUMParent = -1 and posLayer gives you the index of the layer selected in the drop down list.

    Code:
    if (pPos->posOINUMParent == -1)
    {
        // Actual coordinates
       layer = pPos->posLayer;
    }
    else
    {
        // Relative to
        // This case is more complex to handle as it depends on object selection AND if you are in a condition, action or expression...
    }
    I suggest that if you want a layer information in all cases you forget PARAM_POSITION and use your own X, Y and Layer parameters.

  9. #9
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    prester's Avatar
    Join Date
    Feb 2010
    Location
    japan
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sry for delay.

    short WINAPI DLLExport ACT_TEST(LPRDATA rdPtr, long param1, long param2)// TEST Action
    {
    LPPOS pPos = (LPPOS)&rdPtr->rHo.hoCurrentParam->evp.evpW.evpW0;
    auto layer = 0;
    switch (pPos->posOINUMParent)
    {
    case(-1):
    layer = pPos->posLayer;
    __fallthrough;
    default:
    CHECK_VALUE_MESSBOXW(pPos->posOINUMParent, _T("pPos->posOINUMParent; = "), _T("TEST"));
    break;
    };
    return 0;
    };

    I am still low understanding level.
    I've tried this code but anything no reaction from ACT_TEST function, then i noticed the target object's "Create at start" checkbox is off.

    If the Checkbox is on, returns number 1|2|3.. etcs, but not found case of -1.

    defisym's explanation exactly bit complex and still i can't understand (I thanks for defisym >> will learn from you and andos's source codes).

    Quote Originally Posted by Yves View Post
    I suggest that if you want a layer information in all cases you forget PARAM_POSITION and use your own X, Y and Layer parameters.
    Unfortunately, The only solutions i can do now, Yes, i will forget to get from the PARAM_POSITION.
    (or make a custom Dialog window.)

    Thank a lot!

Similar Threads

  1. Android New Dialog prompt dialog text
    By AkaiR in forum Android Export Module 2.5
    Replies: 4
    Last Post: 21st March 2018, 10:12 PM
  2. Android New Dialog Control dialog text looks small
    By lh37 in forum Android Export Module Version 2.0
    Replies: 19
    Last Post: 19th April 2014, 05:42 PM
  3. Dialog
    By mnovoa in forum iOS Export Module 2.5
    Replies: 1
    Last Post: 8th April 2014, 05:25 PM
  4. Dialog Box
    By JosephFTaylor in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 2nd December 2011, 12:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •