Announcement

Collapse
No announcement yet.

Visi color change

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Visi color change

    Hi,

    Could you please say me how can i change a button color in visi application?

    iWinbutton17.Color and derivatives does not work!

    Best regards,
    Serkan

  • #2


    Ypu can't change a color by direct editing.

    After you click on a color field's value and ellipses (...) appears to the right, click on that to edit the color.
    Mark

    Comment


    • #3


      Hi,

      I cant beleive this. if so, whole of my work with Visi will be meaningless. I set up user interface with forms and pasted all codes into project. But buttons are used to indicate a signal is present or not. I m receiving some message over rs-232 and update button colors in run time execution. In run time it is not possible to go color field and click it. There must be a way to do this as all other visual programming provides this functionality.

      isnt there any way to change button color in runtime? or is there any workaround for it ?

      or what is your suggestion for using indicators whose colors are changed during program execution ?


      The problem is that; when i use visi application buttons and user interface becomes more sensetive about colors and seems well as well as writing code is easier, however; when i use direct coding by using gfx commands it is hard to code for touch sense and colors are not good as in visi.

      Best regards,
      Serkan

      Comment


      • #4


        To solve your problem, create two buttons in the same location, but with different colors.

        Display the 'correct' on at any given time.


        You can't expect a tiny chip chip to give you 'Windows' functionality the same way as Windows does.

        You just need to think outside the box a bit
        Mark

        Comment


        • #5


          is it the same for caption as well? I mean changing of the button text. do i need to add a new button for every button text?
          Serkan

          Comment


          • #6


            For changing the text of a button you can either print it over the button immediately after displaying it.

            For 'neater' text, you can use a strings object and use it in the same way.
            Mark

            Comment


            • #7


              Could you please give me example of implementations:

              - How to make a button visible and not visible
              - How to change a button text

              When i clarify these i will update the codes and finilaze user interface. I hope device flash size will be enough since the button count will be double for color change requirement.

              Best regards,
              Serkan

              Comment


              • #8


                I don't know how you are going for FLASH space, but an extra button only uses about 28 bytes.

                Have a look at the attached Attached files ThreebuttonText.zip (5.9 KB)
                Mark

                Comment


                • #9


                  Alternatively, you could do it the old fashioned way (pre-Visi), load all your images into graphics composer, dump the results into a raw sector, and have unlimited buttons and other graphics with no additional overhead......

                  It might seem like a bit more work, since you need to create the button images yourself, but in reality its pretty easy (and a bit faster to display, to boot)....

                  The biggest downside is you need to do more of the touch detection yourself.....
                  _______________
                  Best Regards,
                  Howard

                  Comment


                  • #10


                    I dont like to sense button touch and draw buttons myself That is why i chose visi application. I already completed a project with that way which it time consuming. Visi is best but i think needs to be developed a little more. For example color change feature is quite important and should be involved.

                    Anyhow, i will try to double buttons and change strings as indicated here. You say a button uses 28 bytes what happens when using tenths of buttons. Infact, i think visi adds some other codes a part from display to init buttons. When i complete project i will try to remove some default codes inserted by visi in order to save flash space.

                    Thanks for your helps,

                    Best regards,
                    Serkan

                    Comment


                    • #11


                      I think img_SetWord should be used for writing different things on image entries. There is an example of this function usage in manual as shown below;

                      func cat()
                      var private frame :=0;
                      var private image :=SPRITE_CAT;
                      var private speed :=30;

                      img_SetWord(Ihndl, image, IMAGE_INDEX, frame++);

                      frame:=frame % img_GetWord(Ihndl,image,IMAGE_FRAMES);

                      img_Show(Ihndl,image);
                      sys_SetTimer(TIMER3,speed)

                      i think this function continously changes image value. I m using buttons but they are also images as well.

                      at least i could use img_GetWord to get image/button position that i can overwrite.

                      Best regards,
                      Serkan

                      Comment


                      • #12


                        Sorry, I don't understand your question.

                        Yes, img_SetWord can be used to set the X and Y positions of an image/video

                        A button is a 4 frame video the frame that is displayed is based on its 'position', IIRC up=0, up-pressed=1, down=2, down-pressed=3
                        Mark

                        Comment


                        • #13


                          I tough img_SetWord may be used to give a string by using offset as IMAGE_LOWORD. But i think this does not mean image label.

                          Anyhow, i used img_GetWord to find button position and over printed by using print and putnum. They are working.

                          Hopefully, my second user interface application will be completed after a few minutes later.

                          From now on, i think i will go with Visi and will be update the tool into Workshop 4.

                          Best regards
                          Serkan

                          Comment

                          Working...
                          X