Home Forums Macros Matrix – personnaliser l’affichage des boutons

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6293
    WilliamNicolasWilliamNicolas
    Participant

    Salut,
    J’aimerais faire une interface avec 2 lignes et faire apparaitre sur chaque ligne 4 boutons et 4 dials. C’est possible ?
    Merci !

    #6294
    Philippe OllivierPhilippe
    Keymaster

    Salut,
    Oui, c’est possible en mettant le code ci-dessous en entête de macro
    Philippe

    Declare Local Once boolean $firstTime$ = true
    Declare Local int $itemID$ = 1
    Declare Local int $itemSize$ = 56

    If { $firstTime$ }
    $firstTime$ = false
    SendData thispatcher itemamount 0
    SendData mainWindow setsize 463 {30 + ($itemSize$ * 2)}
    SendData thispatcher itemamount 16

    WaitDuration 100

    $itemID$ = 5

    DoRepeat
    SendData thispatcher itemtype $itemID$ dial
    SendData thispatcher itemtype {$itemID$ + 8} dial
    SendData item dial $itemID$ name $itemID$
    $itemID$ = {$itemID$ + 1}
    WaitDuration 10
    While {$itemID$ < 9}

    SendData item button 0 fontface regular
    SendData item button 0 bgcolor 0. 0. 0. 1.
    SendData item button 0 bgoncolor 0.773 0.145 0.196 1.
    SendData item button 0 bordercolor 0.251 0.533 0.643 1.
    SendData item button 0 borderoncolor 0.2 0.2 0.2 1.
    SendData item button 0 textcolor 0.827 0.827 0.824 1.
    SendData item button 0 textoncolor 0.827 0.827 0.824 1.

    SendData item dial defaultSettings

    SendData thispatcher basicdisposition

    SendData MacroInitialized
    MacroStop
    EndIf

    // Which Case is it ?
    Message { “Button or Dial number ” + currentCaseValueString() + ” : ” + currentCaseOptionValueFloat(0)}

    • This reply was modified 8 months ago by Philippe OllivierPhilippe.
    • This reply was modified 8 months ago by Philippe OllivierPhilippe.
    #6297
    Philippe OllivierPhilippe
    Keymaster

    Quelques explications :

    Par défaut, Matrix charge des boutons.
    Donc, dans un second temps, après avoir créé la matrice de buttons, tu peux changer le type de certains boutons.
    Cela se fait en utilisant la syntaxe suivante :

    SendData thispatcher itemtype 1 dial

    Ici, je l’utilise dans une boucle DoRepeat//While avec la variable $itemID$ pour définir le numéro de l’item que je souhaite modifier.
    Philippe

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.