* iupScrollbox woes

For plugin authors to discuss plugin programming
Post Reply
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

iupScrollbox woes

Post by shoshk »

Working on my data entry screen...

Sometimes, there are just a few fields:

And, sometimes, there are a lot:
image.png
image.png (55.73 KiB) Viewed 928 times

I generate the data entry screen dynamically on a basis of a definition file and I use iupScrollbox to manage scrollbars, in the event that there are more fields than can fit on the screen at one time.

So, my first problem...

iupScrollbox does not seem to add scrollbar properly. When it adds the vertical scrollbar, it causes a horizontal scrollbar to appear also; it seems that it's not taking the space occupied by the vertical scrollbar into account.

Is there a solution?

Thanks
Shosh Kalson
User avatar
tatewise
Megastar
Posts: 28488
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: iupScrollbox woes

Post by tatewise »

I have tried setting SCROLLBAR="VERTICAL" instead of the default "YES" but that makes no difference.

The only way I could eliminate the horizontal scrollbar was to force the SIZE of the dialogue to be wider.
e.g.

Code: Select all

   local strSize = dlg.SIZE
   local intWidth = tonumber( strSize:match( "^(%d+)x" ) ) + 30  -- Increase width by 30
   dlg.SIZE = strSize:gsub( "^%d+", tostring(intWidth) )  -- Make dialogue wider
   iup.Map(dlg)
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: iupScrollbox woes

Post by shoshk »

Where do you put this code? If I put it right after creating the dialog, it makes a narrow window.
Shosh Kalson
User avatar
tatewise
Megastar
Posts: 28488
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: iupScrollbox woes

Post by tatewise »

Put it after you have populated all the fields and the dialogue has been mapped.
e.g.

Code: Select all

  dlg:showxy(iup.CENTER, iup.CENTER)

   local strSize = dlg.SIZE
   local intWidth = tonumber( strSize:match( "^(%d+)x" ) ) + 30
   dlg.SIZE = strSize:gsub( "^%d+", tostring(intWidth) )
   iup.Map(dlg)
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply