-
February 7th, 2019, 06:15 #1
Window/subwindows and combobox odd behavior
I am having some odd behavior with combobox within a subwindow.
In a Story window I've added a subwindow (author_header) above the typical "header" subwindow and attached the header to the bottom of the author_header. Within the author_header subwindow I've added 2 labels, a checkbox and a combobox.
When using the combobox that has a selection already (see animated gif below) the combobox opens but the view is slid down and the top of the combobox is pushed up where it's not visible. In the animation you can see that when I move the mouse up (when I go to the right side) to the author_header section and use mousewheel it will snap up to top and look normal.
Is there an event I can capture that I can then run "setScrollPosition(0,0)" on the subwindow and correct this when the combobox is opened? Or is there another way to deal with this?
https://i.imgur.com/003RMZq.gifv
The subwindow template and combobox template are nothing special but here they are:
Code:<template name="note_author_header"> <subwindow> <anchored> <top offset="23" /> <left offset="15" /> <right offset="-15" /> </anchored> <activate /> <fastinit /> </subwindow> </template> <template name="author_frameselect"> <combobox> <script> function onInit() super.onInit(); addItems(AuthorManagerADND.aBlockFrames); end </script> <anchored> <top parent="rightanchor" offset="8" /> <left offset="45" /> <right offset="-90" /> </anchored> <listdirection>down</listdirection> <listmaxsize>8</listmaxsize> </combobox> </template>
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
February 7th, 2019, 06:54 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
It's because the combobox is actually an amalgation of controls, and the combobox creates a windowlist control above itself by default. Because your combo box is at the top of the window, the window is trying to re-layout to accommodate the extra controls.
If you specify a <listdirection>down</listdirection> tag for your template, the combobox should append the selection list below the string field.
Regards,
JPG
-
February 7th, 2019, 16:01 #3
I do have listdirection set to down. Or do you mean somewhere else?
Code:<template name="author_frameselect"> <combobox> <script> function onInit() super.onInit(); addItems(AuthorManagerADND.aBlockFrames); end </script> <anchored> <top parent="rightanchor" offset="8" /> <left offset="45" /> <right offset="-90" /> </anchored> <listdirection>down</listdirection> <listmaxsize>8</listmaxsize> </combobox> </template>
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
February 7th, 2019, 17:40 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
Apologies, that's what I get for answering late, and making assumptions.
Looking at it again and knowing that the combobox is down; I'm going to guess that the combobox is within a subwindow which is dynamically sizing larger when the combobox list is created? If that's the case and the other controls are anchored to the subwindow, then they will be pushed down when the subwindow resizes.
It's a known limitation of the combobox limitation that it doesn't play nice within nested subwindows, because it is an amalgamation of controls and laid out as inidividual controls. If you have it nested, then it will either be clipped (if using fixed height subwindow) or will expand the subwindow (if using dynamic height subwindow). This is similar for child windows of a windowlist.
Regards,
JPG
-
February 7th, 2019, 17:57 #5---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
February 7th, 2019, 23:37 #6
Not the way I wanted to do it but this works.
(cycler). It took some tinkering to initialize the non-static data.
https://i.imgur.com/zpdj5nv.gifv
Here is the meat of it.
Code:<template name="author_frameselect"> <button_stringcycler> <script> function onInit() local sSelections = ""; for _, sItem in pairs(AuthorManagerADND.aBlockFrames) do sSelections = sSelections .. sItem .. "|"; end super.onInit(); super.initialize(sSelections, sSelections,DB.getValue(window.getDatabaseNode(),"ref_frame",AuthorManagerADND.aBlockFrames[1])); super.updateDisplay(); end </script> <anchored width="80" height="15"> <top parent="rightanchor" offset="8" /> <left anchor="center" offset="-40" /> </anchored> </button_stringcycler> </template>
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks