Skip to main content
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

Uniface 9: Icon and text on a button

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 replies

Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

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

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)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

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

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)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

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

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)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

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

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)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

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

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)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

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

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)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

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

  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)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

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

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)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

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

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)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:37 AM UTC

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

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)