inputbox width

Post

Posted
Rating:
#1 (In Topic #773)
Regular
bill-lancaster is in the usergroup ‘Regular’
Is it just me?  inputbox is now shown as quite narrow in width.
For example:-

Code

InputBox("Enter description", "Document description", sVar)
looks like the attached image where the prompt is just "Enter".  Also the width of the box is partly affected by the length of the promt.
Any ideas?

Gambas 3.16.3
Kubuntu 20.04

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
Hi Bill, only me!

I noticed that the help file says the Prompt is rich text.

<IMG src="https://www.cogier.com/gambas/Inputbox2.png"> </IMG>

So if you change the Prompt as below: -

Code (gambas)

  1. InputBox("<h1> Enter description </h1>", "Document description", sVar)

You get: -
<IMG src="https://www.cogier.com/gambas/Inputbox.png"> </IMG>

If this is not wide enough, my tests showed you could use 29 characters while using Header 1 (<h1>)
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
This is the code from the InputBox class…

Code (gambas)

  1.  
  2.   panBox.W = Max(Desktop.Scale * 48, lblMessage.W)
  3.  
  4.  
  5.  

Desktop.Scale is the standard desktop font width so it's limited to 48 normal chars wide otherwise the message text box is set by the text message width.
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
bill-lancaster is in the usergroup ‘Regular’
Thanks Cogier, hadn't thought to check the help pages!
Now:-

Code

InputBox("<h1>Enter Year<h1>", "Year of the document date")

looks like:-

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#5
Guru
BruceSteers is in the usergroup ‘Guru’
 If you want control Bill InputBox is really easy to import into your program.

Just copy files InputBox.class / FInputBox.class / FInputBox.form into your .src folder from the gambas source in /comp/gb.form/.src
Then rename InputBox.Class to MyInputBox.class (or something)

then you can edit the FInputBox.class file to make the window bigger

InputBox code looks kinda iffy to me.

Try this one…
I've made the InputBoxW.class take another MinWidth arg to set a min width if required
plus made it convert "\n" to "<br>"
plus made the window resize a bit differently…
Online now: No Back to the top

Post

Posted
Rating:
#6
Regular
bill-lancaster is in the usergroup ‘Regular’
 The problem occurs with QT4/5.
With GTK inputbox works properly - the width of the textbox seems to be set by the with of text as Bruce points out.
Will give inputboxw a try
Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Enthusiast
GrayGhost is in the usergroup ‘Enthusiast’
I have found there are other differances between QT and GTK, screen display is just one another is printing, one uses 72 dpi the other uses 300 dpi.
I guess it depends on the distro and desktop you use which is best for you.
Since I use Ubuntu and Gnome, GTK is best  for me.

There are just too many choices to make in this world  :D
Online now: No Back to the top
1 guest and 0 members have just viewed this.