Thread: Problem with control anchors
-
November 20th, 2017, 19:43 #31
-
November 20th, 2017, 20:31 #32
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Still trying to figure out anchoring and control sizing. Within the table_main.xml file of the CoreRPG ruleset, there is a windowclass definition of table_main. And within that windowclass there is this control definition:
Code:<string_column_full name="description"> <empty textres="table_emptydesc" /> </string_column_full>
-
November 20th, 2017, 21:12 #33
How does FG know how big to make it?
I can't speak for table_main, and I'm doing this on my iPhone, but for masterindex, it pretty slick. There is a min size for the masterindex windowclass. Then there are three main anchors. One just below the form's title, one just below the list and one at the bottom of the form. The list's bottom anchor is attached to the bottom of the form anchor. The controls just below the list, including the filters are attached to the anchor just below the list. When there are no filters, the bottom of form anchor is really at the bottom of the form and because the list is resizable it fills the form. If there are filters, a lua routine calculates how much room is needed below the list and moves the bottom of form anchor up that much. The list collapses that much and the filters fit below the list and above the bottom of the form.
So what the hell dies this mean for you? Tables are even mor dynamic that a list because they work in two dimensions. As columns are added, it wouldn't surprise me if something similar is going on.
My suggestion: figure out where every control's four anchors are. If the controls (e.g. columns or rows) dynamically change size look for a setAnchor() call (it's a member of windowcontrol).
-
November 20th, 2017, 22:54 #34
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
For controls, if the width and/or height is not defined, then the width/height will be calculated automatically during the window layout routine. At least one vertical anchor and at least one horizontal anchor is still required, and is thus the minimum necessary for an anchored definition. Additional anchors or specified width/height are optional.
Each control will perform it's automatic width/height calculation differently, based on the type of control it is.
- formattedtextcontrol (width defined) - W=Defined width; H=Height necessary to display formatted text within width
- numbercontrol (always single line) - W=Width of display string based on font asset; Height of display string based on font asset
- stringcontrol (not multiline or width not defined) - W=Width of text string based on font asset; H=Height of text string based on font asset
- stringcontrol (multiline and width defined) - W=Defined width; H=Number of lines to fit wrap text within defined with multiplied by multiline height tag value
- subwindow - W=0; H=0 (if contained window not instantiated); H=instantiated window height
- windowlist - W=0; H=total height of list child windows (each child recalculates layout size based on width of list control)
- otherwise - W=0; H=0
(includes buttoncontrol, chatwindow, diecontrol, formattedtextcontrol (no width defined), genericcontrol, imagecontrol, portraitselectioncontrol, scrollbarcontrol, scrollercontrol, tokenbag, tokencontrol, windowreferencecontrol)
Cheers,
JPG
-
November 21st, 2017, 05:01 #35
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Thanks, MW.
-
November 21st, 2017, 05:45 #36
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
OK, one more, MW or Trenloe or whoever has the controls mastered:
I want a multiline string box that will have a scrollbar (vertical) if it needs it. I checked the character sheet of CoreRPG, and the Notes section of the character sheet has a scroll bar if you fill up the allotted vertical space. That control is a stringu, defined in common.xml as:
Code:<stringfield> <font>sheettext</font> <lineoffset default="on" mergerule="replace">1</lineoffset> </stringfield>
Code:<basicstring name="preprocessor"> <empty textres="generator_emptyforward" /> <anchored position="insidetop" offset="-5" height="100"/> <invisible /> <multilinespacing>20</multilinespacing> </basicstring>
Code:<template name="basicstring"> <simplestring> <frame mergerule="replace" name="fielddark" offset="7,5,7,5" hidereadonly="true" /> <stateframe> <keyedit name="fieldfocus" offset="7,5,7,5" /> <hover name="fieldfocus" offset="7,5,7,5" hidereadonly="true" /> <drophilight name="fieldfocus" offset="7,5,7,5" hidereadonly="true" /> </stateframe> </simplestring> </template>
-
November 21st, 2017, 15:39 #37
Are you positive you can have attach a scrollbar to a simple string? All the basic string controls I am familiar with don't have scrollbars. It seems as though they allow multi line text, but don't have that pop up scroll bar. only the formatted text (free form text) fields seem to support it. (e.g. record_story.xml)
Additionally, I think you need to "attach" a scrollbar object to it. I suspect you have done this, I just don't see it there. Is that what "multilinespacing" does?
-
November 21st, 2017, 16:05 #38
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Let me go back and look at the caharacter page notes. I think you are right that I need to attach a scrollbar
-
November 21st, 2017, 16:26 #39
I was looking at a couple of the other CoreRPG library dialogs for small, basic text fields. NPCs has a few on the form. For it, if you put multiple lines of text in a box the box expands to fit it, until it is too tall to fit on the form then a scrollbar for the entire form appears. The scroll bar doesn't appear to be attached to the box itself but to the whole of the windowclass (see record_npc.xml). The individual text controls are basicstrings. So maybe you can't attach a scrollbar to them - I don't know. Personally I'd search the whole ruleset for the type of control you want to use, e.g. basicstring, see what windowclasses and templates it's in then look to see if scrollbars are ever attached to it. (a Hecka-Ton to work, I know!)
-
November 21st, 2017, 16:52 #40
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Look at the character notes page in the character sheet. That has individual scroll bars on the bottom notes field
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks