The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 GETN_ADD_LEFT_CHECK

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
couturier Posted - 07/31/2018 : 08:29:37 AM
Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: 10

In a dialog, I can add a checkbox on the left of an item with GETN_ADD_LEFT_CHECK
How can I know if user checked or unchecked it ?

thanks
7   L A T E S T    R E P L I E S    (Newest First)
couturier Posted - 08/13/2020 : 11:14:08 AM
quote:
If you prefer setting up the dialog by coding the treenodes explicitly than using GETN macros ...

This is because I'm building this part after the dialog is open, based on some dialog events
Castiel Posted - 08/10/2020 : 9:17:54 PM
quote:
Originally posted by couturier

adding ONODETYPE_EDIT_BOX_ONELINE_TEXT option in treenode.addtextnode
did the trick

Thanks a lot

PS: I like your new signature



NodeID like ONODETYPE_EDIT_BOX_ONELINE_TEXT plays an important role in GetN. If you prefer setting up the dialog by coding the treenodes explicitly than using GETN macros, always remember to assign the correct NodeID. In code builder, alt-shift-o to open oc_const which contains all pre-defined NodeIDs.

The new signature I have used in other places for some years. It comes to me more often since the very beginning of 2020 and I applied it as my profile signature.


------------------------------------------
       Be The Change
             You Want To See
                   In The World
------------------------------------------
couturier Posted - 08/10/2020 : 08:44:23 AM
adding ONODETYPE_EDIT_BOX_ONELINE_TEXT option in treenode.addtextnode
did the trick

Thanks a lot

PS: I like your new signature
Castiel Posted - 08/10/2020 : 06:52:32 AM
quote:
Originally posted by couturier

I come up again with this topic

I have a dialog in which thoses nodes are added like this

TreeNode trC = myTree.Param.AddTextNode(strText, "Cycle" + ii);
trC.SetAttribute(STR_LABEL_ATTRIB, "Cycle " + ii);
trC.SetAttribute(STR_ATTRIB_DYNACONTROL_USE_CHECK, 1 );
trC.SetAttribute(STR_ATTRIB_HANDLER_RC, dialog_event);


dialog_event will be triggered when user edits the node text
However i'd like the event to be triggered WHEN users checks or unchecks the left checkbox.

How can I do that ?

thanks



The event will be triggered when toggling the checkbox or updating the text. I'm not sure if you can have it triggered only when toggling the checkbox. Have a try of this:

bool node_event(TreeNode& tr, int nRow, int nCol, TreeNode& trNode, DWORD nEventInfo, int nCntrlType, WndContainer& getNContainer)
{
    if(trNode.DataID == 0x01000000)
        printf("%s: %s\n", tree_is_left_checkbox_checked(trNode) ? "Checked" : "Cleared", trNode.strVal);

    return true;
}
void MyTriggerEvent()
{
    Tree myTree;
    TreeNode trC = myTree.Param.AddTextNode("Text Value", "Cycle", ONODETYPE_EDIT_BOX_ONELINE_TEXT);
    trC.SetAttribute(STR_ATTRIB_DYNACONTROL_USE_CHECK, 1 );
    trC.SetAttribute(STR_LABEL_ATTRIB, "Cycle Value");
    trC.DataID = 0x01000000;

    trC.SetAttribute(STR_ATTRIB_HANDLER_RC, node_event);

    if(GetNBox(myTree))
        return;
}


Show your code if toggling the checkbox does not trigger the event.


------------------------------------------
       Be The Change
             You Want To See
                   In The World
------------------------------------------
couturier Posted - 08/09/2020 : 05:29:38 AM
I come up again with this topic

I have a dialog in which thoses nodes are added like this

TreeNode trC = myTree.Param.AddTextNode(strText, "Cycle" + ii);
trC.SetAttribute(STR_LABEL_ATTRIB, "Cycle " + ii);
trC.SetAttribute(STR_ATTRIB_DYNACONTROL_USE_CHECK, 1 );
trC.SetAttribute(STR_ATTRIB_HANDLER_RC, dialog_event);


dialog_event will be triggered when user edits the node text
However i'd like the event to be triggered WHEN users checks or unchecks the left checkbox.

How can I do that ?

thanks
couturier Posted - 08/01/2018 : 04:09:18 AM
quote:
bool tree_is_left_checkbox_checked(TreeNode& trN)

Undocumented function :-/

Thanks a lot for your help
Castiel Posted - 08/01/2018 : 01:50:58 AM
quote:
Originally posted by couturier

Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: 10

In a dialog, I can add a checkbox on the left of an item with GETN_ADD_LEFT_CHECK
How can I know if user checked or unchecked it ?

thanks



bool tree_is_left_checkbox_checked(TreeNode& trN)



     #####
    #### _\_  ________
    ##=-[.].]| \      
    #(    _\ |  |------|
     #   __| |  ||||||||
      \  _/  |  ||||||||
   .--'--'-. |  | ____ |
  / __      `|__|[o__o]|
_(____nm_______ /____\____ 

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000