Icon and text on a button

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I'm trying to align an icon and text over a button, but I cannot reach my goal. I want to put the glyph on the left in his real size and text on the right. Someone can help me?Embarassed In the image all property both Field and Widget, and lower left my "button".  Immagine.png  I'm using 9.6.05.01 (0519_1) Thanks all in advance Claudio

21 Comments

  1. Hello. You should use a so called internalized label for this and attach it to the button. In this case the button (with the glyph) should be painted on the left and the label (with text) on the right. For details see: >Uniface Library > Developing Desktop Applications > Labels: paragraph "Internalized Labels" Hope this helps. Kind regards, Daniel Iseli Uniface Technical Support


    Author: diseli (daniel.iseli@uniface.com)
  2. diseli said Hello. You should use a so called internalized label for this and attach it to the button. In this case the button (with the glyph) should be painted on the left and the label (with text) on the right. For details see: >Uniface Library > Developing Desktop Applications > Labels: paragraph "Internalized Labels" Hope this helps. Kind regards, Daniel Iseli Uniface Technical Support  

    Thanks for quick answer Daniel. So, I can put together image and text in a button but I can't not arrange objects as I want? Sorry but I don't understand the sense of that, or I have not understood the logic of Uniface (although I'm are sure the second statement is more correctConfused) How can I diplay the standard Uniface glyph at his original size to achieve my goal? Thanks Claudio


    Author: Claudio (claudio.palladini@cortislentini.it)
    1. Please see http://unifaceinfo.com/samples/
    2. Scroll all the way down to 'GUI Sample: Command Buttons'
    3. Click the 'ReadMe' button or this link
    4. Example 'Style 3: Simple Button with Image and Text (New)' will fit your needs.

    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
  3. I had another look at this and there's also an alternative way, without using a label:

    1. Draw button 12x3
    2. Define data type of button as String
    3. Define as Initial Value (without the double quotes): "^U8_ARCOK·!Save"

      button.jpg


    Author: diseli (daniel.iseli@uniface.com)
  4. FYI: You can change the position of the image relative to the text on the button with the property ImageLabelAlign and the the size of the image with ImgSize. For details see: >Uniface Library >Uniface Reference > Widgets: Forms and Reports > Command Button  At the bottom there's also an example for setting the properties in Proc:


    Author: diseli (daniel.iseli@uniface.com)
  5. diseli said I had another look at this and there's also an alternative way, without using a label:
    1. Draw button 12x3
    2. Define data type of button as String
    3. Define as Initial Value (without the double quotes): "^U8_ARCOK·!Save"
    postimage  

    4. Click the '>>' button close to the Widget Type dropdown list and choose Label Image Size 'Extra Large'.


    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
  6. diseli said I had another look at this and there's also an alternative way, without using a label:
    1. Draw button 12x3
    1. Define data type of button as String
    1. Define as Initial Value (without the double quotes): "^U8_ARCOK·!Save"
      postimage  

    Thanks Arjen and thanks Daniel. Daniel, could you provide larger images?Confused Claudio


    Author: Claudio (claudio.palladini@cortislentini.it)
  7. Arjen van Vliet said
    diseli said I had another look at this and there's also an alternative way, without using a label:
    1. Draw button 12x3
    1. Define data type of button as String
    1. Define as Initial Value (without the double quotes): "^U8_ARCOK·!Save"
    postimage  
    4. Click the '>>' button close to the Widget Type dropdown list and choose Label Image Size 'Extra Large'.  

    If you want to show the glyph U8_ARCOK in its original size (16x16 px) then you should use the default Label Image Size (Small = 16x16 px).


    Author: diseli (daniel.iseli@uniface.com)
  8. I got it work! There is a way to reduce the invisible grid precision where visual components are docked? Now my button is...or too little or too big! Laugh Thanks again Claudio


    Author: Claudio (claudio.palladini@cortislentini.it)
  9. Claudio said I got it work! There is a way to reduce the invisible grid precision where visual components are docked? Now my button is...or too little or too big! Laugh Thanks again Claudio  

    Good to hear. I guess that by "invisible grid precision" you mean the cell size. In case you want to make the horizontal size of the button smaller then you can reduce the Percentage value for the Vertical Button Size (e.g. 80).


    Author: diseli (daniel.iseli@uniface.com)
  10. Thanks Daniel, I mean the invisible grid's (where visual components are docked) accuracy. For example: if default is 10px, I want to modify it to a smaller or greater size. Because often my unifacers colleague (and I too) run into this problem Immagine.png And nit-pick customers everytime says: "I told you, why you don't fix it?" Laugh Thanks Claudio


    Author: Claudio (claudio.palladini@cortislentini.it)
  11. diseli said
    Claudio said I got it work! There is a way to reduce the invisible grid precision where visual components are docked? Now my button is...or too little or too big! Laugh Thanks again Claudio  
    Good to hear. I guess that by "invisible grid precision" you mean the cell size. In case you want to make the horizontal size of the button smaller then you can reduce the Percentage value for the Vertical Button Size (e.g. 80).   

    So, I cannot specify custom dimensions in px? Why the choice to permit only resizing vertical? Confused Thanks Claudio


    Author: Claudio (claudio.palladini@cortislentini.it)
  12. Claudio said Thanks Daniel, I mean the invisible grid's (where visual components are docked) accuracy. For example: if default is 10px, I want to modify it to a smaller or greater size. Because often my unifacers colleague (and I too) run into this problem Immagine.png And nit-pick customers everytime says: "I told you, why you don't fix it?" Laugh Thanks Claudio  

    Moreover this aspect does not occur at design time, forcing developer to have to check at run time the appearance of the mask, right? Immagine.png Thanks Claudio


    Author: Claudio (claudio.palladini@cortislentini.it)
  13. Hi Claudio, Uniface does not offer functionality to positions by the pixel. Positioning is done in character cells of the size of the Font0 (canvas font) that is in your .ini file. From your screenshots it seems you are using a font for some fields that is slightly bigger than font 0. That could also explain why you have a difference between development and runtime.  Hope this helps, Theo


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  14. Hi Theo, and thanks for your feedback.

    Theo Neeskens said From your screenshots it seems you are using a font for some fields that is slightly bigger than font 0. That could also explain why you have a difference between development and runtime. 

    In all components the is the same, the default. At the design time and also at run time (Assuming I'm looking at the right properties in the widget).

    Theo Neeskens said Uniface does not offer functionality to positions by the pixel. Positioning is done in character cells of the size of the Font0 (canvas font) that is in your .ini file.

    What is the sense? Why not let developers the possibility to optimize the space at will?  Thanks Claudio


    Author: Claudio (claudio.palladini@cortislentini.it)
  15. What is the sense? Why not let developers the possibility to optimize the space at will?  Thanks Claudio  

    the pixel vs character spacing is all due to Uniface still supporting character mode deployment. There isn't a way we can cleanly mix and match them, we've looked into this a couple of times over the years, (Uniface 8.4 and Uniface 9.6 from my memory). 


    Author: Adrian Gosbell (adrian.gosbell@synapse-i.jp)
  16. Adrian Gosbell said
    What is the sense? Why not let developers the possibility to optimize the space at will?  Thanks Claudio  
    the pixel vs character spacing is all due to Uniface still supporting character mode deployment. There isn't a way we can cleanly mix and match them, we've looked into this a couple of times over the years, (Uniface 8.4 and Uniface 9.6 from my memory).   

    It's not possible to decide the "scope" during creation of project/form?


    Author: Claudio (claudio.palladini@cortislentini.it)
  17. Claudio said
    Adrian Gosbell said
    What is the sense? Why not let developers the possibility to optimize the space at will?  Thanks Claudio  
    the pixel vs character spacing is all due to Uniface still supporting character mode deployment. There isn't a way we can cleanly mix and match them, we've looked into this a couple of times over the years, (Uniface 8.4 and Uniface 9.6 from my memory).   
    It's not possible to decide the "scope" during creation of project/form?  

    Ciao Claudio, as of today (U9.7.02.G202) not yet... The only choice available today is to reduce the basic cell size (Canvas font or Font0) to have a denser grid. This has an (obvious) implication on size of other objects (entities / fields) defined on screen/reports. This is a basic discussion I always had with all new customer starting with Uniface but almost all of them decided to stick with standard Uniface configuration (usys.ini) to avoid to be obliged to maintain the custom version forever. Having more "rapresentation scope" either pixel based or cell based could be a nice improvement for next Uniface versions...Add it to wishlist! ;-) Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  18. Claudio said
    Adrian Gosbell said
    What is the sense? Why not let developers the possibility to optimize the space at will?  Thanks Claudio  
    the pixel vs character spacing is all due to Uniface still supporting character mode deployment. There isn't a way we can cleanly mix and match them, we've looked into this a couple of times over the years, (Uniface 8.4 and Uniface 9.6 from my memory).   
    It's not possible to decide the "scope" during creation of project/form?  

    it's not just the painting of the C/S forms, its all the proc functions/statements that would need to be extended to have pixels in addition to characters. 


    Author: Adrian Gosbell (adrian.gosbell@synapse-i.jp)
  19. Adrian Gosbell said
    Claudio said
    Adrian Gosbell said
    What is the sense? Why not let developers the possibility to optimize the space at will?  Thanks Claudio  
    the pixel vs character spacing is all due to Uniface still supporting character mode deployment. There isn't a way we can cleanly mix and match them, we've looked into this a couple of times over the years, (Uniface 8.4 and Uniface 9.6 from my memory).   
    It's not possible to decide the "scope" during creation of project/form?  
    it's not just the painting of the C/S forms, its all the proc functions/statements that would need to be extended to have pixels in addition to characters.   

    A development tool in 2016, it's frustrating. Thanks again Claudio


    Author: Claudio (claudio.palladini@cortislentini.it)
  20. gianni said
    Claudio said
    Adrian Gosbell said
    What is the sense? Why not let developers the possibility to optimize the space at will?  Thanks Claudio  
    the pixel vs character spacing is all due to Uniface still supporting character mode deployment. There isn't a way we can cleanly mix and match them, we've looked into this a couple of times over the years, (Uniface 8.4 and Uniface 9.6 from my memory).   
    It's not possible to decide the "scope" during creation of project/form?  
    Ciao Claudio, as of today (U9.7.02.G202) not yet... The only choice available today is to reduce the basic cell size (Canvas font or Font0) to have a denser grid. This has an (obvious) implication on size of other objects (entities / fields) defined on screen/reports. This is a basic discussion I always had with all new customer starting with Uniface but almost all of them decided to stick with standard Uniface configuration (usys.ini) to avoid to be obliged to maintain the custom version forever. Having more "rapresentation scope" either pixel based or cell based could be a nice improvement for next Uniface versions...Add it to wishlist! ;-) Gianni  

    This is frustrating, there are development environments today that have no limitations in this direction. Thanks again Claudio


    Author: Claudio (claudio.palladini@cortislentini.it)