spk77

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: popup menu actions? (how?) #72835
    spk77
    Participant
      • Topics: 0
      • Replies: 11
      • Total: 11

      i seem to be able to see them here.
      i’ll have to try to build this with care separately; i’m having
      trouble trying to do it within my current method, as it has
      xxx menu entries at the moment. there is stuff there that is new
      to me, takes a little while to process ? – but i get the gist of it.

      so i would need, somehow to make my popup refer to the same table
      that is used for fetching the itemNames, rather than having it all
      doubled up. you’re quick, man ?

      am i seeing that you did change that background colour, from your gif?

      I hope there’s a way to get the menu item names – that would be easier than fetching from a table 🙂

      Good luck for your project 🙂

      in reply to: popup menu actions? (how?) #72833
      spk77
      Participant
        • Topics: 0
        • Replies: 11
        • Total: 11

        Now the code should work…(this forum doesn’t work correctly if there is a letter “i” inside square brackets.)

        that was quick – is that your popup with green text and black bg?

        That’s just a text label.

        in reply to: popup menu actions? (how?) #72827
        spk77
        Participant
          • Topics: 0
          • Replies: 11
          • Total: 11

          For some reason, I can’t paste the correct code inside the “code tags”…

          This line:
          pMenu:addColouredItem(i, itemNames, Colour(0xff21c630), true, false, Image())
          should be:
          pMenu:addColouredItem(i, itemNames[ i ], Colour(0xff21c630), true, false, Image())

          edit: square brackets and letter “i” don’t work in this forum…

          • This reply was modified 6 years, 7 months ago by spk77.
          • This reply was modified 6 years, 7 months ago by spk77.
          in reply to: popup menu actions? (how?) #72822
          spk77
          Participant
            • Topics: 0
            • Replies: 11
            • Total: 11

            Here’s a gif:

            Attachments:
            You must be logged in to view attached files.
            in reply to: popup menu actions? (how?) #72820
            spk77
            Participant
              • Topics: 0
              • Replies: 11
              • Total: 11

              EDIT: now this should work

              I don’t know how to get a text from a menu item, but maybe this would work:

              -- Create a table for menu item names
              itemNames =
              {
              	"blablabla",
              	"blablabla2",
              	"blablabla3"
              }
              
              -- Create a popupMenu
              local pMenu = PopupMenu()
              
              -- Create menu items from the "itemNames" -table
              for itemIndex=1, #itemNames do
              	pMenu:addColouredItem(itemIndex, itemNames[itemIndex], Colour(0xff21c630), true, false, Image())
              end
              
              -- Show the menu
              local ret = pMenu:show(0,0,0,0)
              
              -- Return if nothing is selected
              if ret == 0 then 
              	return
              end
              
              -- Print the correct name from the "itemNames" -table
              -- Here you could send the name to a label
              console(itemNames[ret])
              • This reply was modified 6 years, 7 months ago by spk77.
              • This reply was modified 6 years, 7 months ago by spk77.
              • This reply was modified 6 years, 7 months ago by spk77.
              • This reply was modified 6 years, 7 months ago by spk77.
              in reply to: popup menu actions? (how?) #72819
              spk77
              Participant
                • Topics: 0
                • Replies: 11
                • Total: 11

                Maybe it is possible, but I don’t know how to use this info :)…
                https://www.juce.com/doc/classPopupMenu#a0888091ddab0f599bb9d2fab28153f6b

                Public Types

                enum ColourIds {
                backgroundColourId = 0x1000700, textColourId = 0x1000600, headerTextColourId = 0x1000601, highlightedBackgroundColourId = 0x1000900,
                highlightedTextColourId = 0x1000800
                }
                A set of colour IDs to use to change the colour of various aspects of the menu. More…

                in reply to: popup menu actions? (how?) #72818
                spk77
                Participant
                  • Topics: 0
                  • Replies: 11
                  • Total: 11

                  oh great, thanks ! one more thing resolved ?
                  will try that.
                  ‘addColouredItem’ – for each entry? – where did you find that?
                  any indication that the popup background might be able to be
                  coloured? or (…) current selected item ? ;-D

                  i’ve used ‘image()’ for some frames i would otherwise have in
                  an image strip, that works – can’t remember if i’ve tried to
                  have coloured ones, these are monochrome atm.

                  I found it here
                  https://www.juce.com/doc/classPopupMenu#abca9890f63f22575c190c0115a1f3acf

                  and here:

                  https://github.com/RomanKubiak/ctrlr/blob/master/Source/UIComponents/CtrlrMIDI/CtrlrMIDIMon.cpp#L108

                  I don’t know if it’s possible to change the bg-color…

                  in reply to: popup menu actions? (how?) #72816
                  spk77
                  Participant
                    • Topics: 0
                    • Replies: 11
                    • Total: 11

                    This seem to work for menu item text color:

                    Tone_params:addColouredItem(1, "toneName1 00 00/VSTindex1", Colour(0xff21c630), true, false, Image())

                    in reply to: Ctrlr 5.4.29 freeze setting new panel colours #72437
                    spk77
                    Participant
                      • Topics: 0
                      • Replies: 11
                      • Total: 11

                      Confirmed.
                      It seems to unfreeze when selecting the same color property again…it’s hard to explain, see the gif below 🙂

                      Attachments:
                      You must be logged in to view attached files.
                      in reply to: typed name dialog? #72435
                      spk77
                      Participant
                        • Topics: 0
                        • Replies: 11
                        • Total: 11

                        Thanks for pointing out that “L() macro” -thing!

                        It’s possible to append a whitespace using “..” operator:
                        newString = "string1" .. " " .. "string2"

                        Here’s “buildString” -function from your panel (http://ctrlr.org/forums/topic/needing-combo-box-to-output-specfic-syses-strings/#post-72418)

                        buildString=function()
                        
                        	-- This stops issues during panel bootup
                        	if panel:getRestoreState() or panel:getProgramState() then return end
                        
                        	local byte1 =  L(panel:getComponent("prefix3") :getText())
                        	local byte2 =  L(panel:getComponent("manufDevID") :getText())
                        	local byte3 =  L(panel:getComponent("address") :getText())
                        	local byte4 =  L(panel:getComponent("suffix3") :getText())
                        
                        	completeSyxExData = byte1 .. " ".. byte2 .. " " .. byte3 .. " " .. byte4
                        	panel:getComponent("destText3"):setPropertyString("uiLabelText", completeSyxExData)
                        end

                        or

                        buildString=function()
                        
                        	-- This stops issues during panel bootup
                        	if panel:getRestoreState() or panel:getProgramState() then return end
                        	completeSyxExData = 
                        		L(panel:getComponent("prefix3") :getText()) 	.. " " ..
                        		L(panel:getComponent("manufDevID"):getText()) 	.. " " ..
                        	 	L(panel:getComponent("address") :getText()) 	.. " " ..
                        		L(panel:getComponent("suffix3") :getText())
                        
                        	panel:getComponent("destText3"):setPropertyString("uiLabelText", completeSyxExData)
                        end
                        Attachments:
                        You must be logged in to view attached files.
                        in reply to: console error #72412
                        spk77
                        Participant
                          • Topics: 0
                          • Replies: 11
                          • Total: 11

                          Confirmed (Win 8.1, Ctrlr-5.5.2)

                          • This reply was modified 6 years, 10 months ago by spk77.
                          Attachments:
                          You must be logged in to view attached files.
                        Viewing 11 posts - 1 through 11 (of 11 total)
                        Ctrlr