MUI suggestions welcome...
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    jqlvld.png

    This image shows a mock-up MUI window for an assembly debugger - it's composed of dozens of Label objects.

    The individual 'x' symbols represent binary fields and I want them to switch between '0' and '1' when they're clicked.

    The grouped 'xxxxxxxx' symbols represent 32bit hexadecimal fields and I want them to be editable when they're clicked.

    Is there a way to find out if a label has been clicked?

    If not, I'm hoping to change those 'x'es to borderless buttons and string gadgets. But how do I make a check-mark style button that shows '1' when activated and '0' when deactivated?

    I'd also be interested to know of other ways to create such a display that relies of far fewer individual objects.
    PPC assembly ain't so bad... ;)
  • »15.03.16 - 19:45
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    You can use this object:
    Code:

    Child, ausPPC = TextObject,
    MUIA_Background, "",
    MUIA_InputMode, MUIV_InputMode_Toggle,
    MUIA_Text_Contents, "0",
    MUIA_FixWidthTxt, "0",
    MUIA_ShowSelState, FALSE,
    End,

    And then some notifies:
    Code:

    DoMethod(ausPPC, MUIA_Notify, MUIA_Selected, TRUE, ausPPC, 3, MUIM_Set, MUIA_Text_Contents, "1")
    DoMethod(ausPPC, MUIA_Notify, MUIA_Selected, FALSE, ausPPC, 3, MUIM_Set, MUIA_Text_Contents, "0")

    For the grouped 'xxxxxxx', you can use a StringObject:
    Code:

    Child, strXXX = StringObject,
    MUIA_Frame, MUIV_Frame_None, // no frame
    MUIA_Background, "", // no background
    MUIA_String_Contents, "00000000",
    MUIA_FixWidthTxt, "00000000",
    MUIA_ShowSelState, FALSE, // if don't want a different select state
    End,
  • »16.03.16 - 11:44
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    Thank you - much appreciated!

    Just one thing, for the uninitiated, in those DoMethod calls it should be 'MUIM_Notify'.
    PPC assembly ain't so bad... ;)
  • »17.03.16 - 04:32
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Tcheko
    Posts: 534 from 2003/2/25
    From: France
    mode pedantic

    Code:

    DoMethod(ausPPC, MUIM_Notify, MUIA_Selected, TRUE, ausPPC, 3, MUIM_Set, MUIA_Text_Contents, "1");
    DoMethod(ausPPC, MUIM_Notify, MUIA_Selected, FALSE, ausPPC, 3, MUIM_Set, MUIA_Text_Contents, "0");


    /mode pedantic

    There is a single notify solution:

    Code:

    DoMethod(ausPPC, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, ausPPC, 4, MUIM_SetAsString, MUIA_Text_Contents, "%ld", MUIV_TriggerValue);


    Saving some bytes. ;)

    ++
    Quelque soit le chemin que tu prendras dans la vie, sache que tu auras des ampoules aux pieds.
    -------
    I need to practice my Kung Fu.
  • »17.03.16 - 07:34
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    I didn't know those attributes could be paired with what looks like a formatting instruction but I like it - thank you for sharing that!

    I haven't yet disassembled MUIA_Background, "" to see what is actually being passed with that attribute but I noticed that the entire area within the window borders becomes highlighted while the string gadget is selected...

    Edit: It appears that setting MUIA_ShowSelState to true or false makes no difference...

    [ Edited by ausPPC 17.03.2016 - 20:59 ]
    PPC assembly ain't so bad... ;)
  • »17.03.16 - 09:36
    Profile Visit Website