Moving from TBX to SpTBX. I used in the past TTbxDockablePanel which has such props:
DockedWidth
DockedHeight
FloatingWidth
FloatingHeight
I can't find such properties in SpTBX panels, so how should I change my code to use such props? ie. i need to get/set SpTBX panel's docked width/height and floating width/height.
DockedWidth and DockedHeight
A TSpTBXDockablePanel now has a property DefaultDockedSize. A docked panel is docked to either a vertical or horizontal dock, so it only needs one size, which specifies the width (in a vertical dock) or height (in a horizontal dock.) The length of the other axis is a result of either the dock size or the other panels in the same dock. If there are other panels, the size it becomes is the width of the other panels in the dock. If there aren't, it will use either the previous size (if DefaultDockedSize is 0) or try to use DefaultDockedSize.
See TSpTBXCustomDockablePanel.SetParent for the code. You'll be interested in the two branches beginning if ToDock then... and if ToFloating then.... There are some comments there that I've tried to interpret to write the above.
From memory, when I converted from TBX to SpTBX years ago, this was the hardest area to get behaving exactly the same. However, you can get it to behave 'okay', ie with behaviour that makes sense, easily.
FloatingWidth and FloatingHeight
Replaced by FloatingClientWidth and FloatingClientHeight. Note that these are the client sizes not window sizes, but in general they should be direct replacements.
In addition
There is a comment at the top of the SpTBXDkPanels.pas file,
// - To handle the size constraints use GetMinMaxSize when the DP is floating,
// and ConstrainedResize when is Docked (explicitly check if it's docked).
You might find that useful too.
There are a reasonable number of comments scattered through the code. The SpTBX library doesn't have very good documentation, but it does come with high-quality source... Use the source, Luke :)
Related
is there a way to alter the spacing of any Delphi FMX component ? all are doubled spaced between lines i believe, i'm sure there is a way to edit the spacing between lines. the most important that it work for FMX
The difference between the two screenshots isn't that they have different line heights or line spacings.
The difference is that the left application is using a variable-width font, while the right application is using a fixed-width (monospaced) font.
You can see this extremely clearly in the top centre part of the image, where you have four full stops (....).
I assume you consider the right screenshot to display the desired appearance. If so, the solution is to change the font in the left application to a fixed-width (monospaced) font.
I use Borland C++ Builder 2009 (yet I assume the issue and solution is the same for Delphi) and right now I assume the answer I'm looking for is the same for both TListView items and TTreeView items. I may be wrong !?
I have noticed, on a smaller Win 8.1 laptop with Display setting 'Change the size of all items' set to 125% . That the items in both TreeView and ListView get closer to each other.
I haven't tested 150% yet, I assume it will be worse.
I would like to adjust for that if possible.
I assume the same logic goes for when a larger sized font is chosen to display these items ?
How would you test if the height of the items is 'too' big and the items need a bit more space between them ?
And how would you increase the spacing between them ? Taking in account that my ListView implementation is virtual (ListView->OwnerData = true ;) !
TForm has Scaled property. If it is true, all components on a form should be resized automatically accordingly to font size. I cannot check right now if this works for TListView and TTreeView, but you should check this property anyway.
I am working inside a Tabpane and I want to have 2 buttons on the bottom-right of the tap-pane, so I thought I just add a LayoutSpacer, but this resulted in
but I wanted it to look like
How can I make my Layoutspacer "bigger"?
In Smart GWT there are different methods to set the size of the component's vertical dimension.
Try with any one
canvas.setHeight100()
canvas.setHeight("100%")
canvas.setHeight("*")
Layouts may specially interpret percentage sizes on their children, and also allow "*" as a size.
In the documentation for TAlignLayout, a type which addresses visual alignment settings for FireMonkey controls, I'm trying to figure out the difference between the alTop and alMostTop constants, the only difference is that the definition of alMostTop contains the phrase "set to be the topmost".
(The same goes for the constants alMostLeft, alMostRight and alMostBottom, which are distinguished from alLeft, alRight and alBottom with similar phrases using the words
"leftmost", "rightmost" and "bottommost".)
I don't know what "set to be the topmost" means, and none of the guesses I make seem to fit with observed FireMonkey behaviour:
If it means displaying that control on top (at the front of the display) relative to its siblings, then what does leftmost mean?
If "leftmost" means it is the sibling shown furthest to the left, out of all siblings that have a alLeft alignment, then why does the CustomListBox demo use a layout with two elements that have a alMostLeft alignment? How does it decide to place the two elements that particular way round?
The Embarcadero forums don't shed any light on this either.
[Update]
To be clear, experiments do indeed suggest that with two components aligned to the top, you can choose which one is to be further up the screen by setting that one to have alMostTop, and the other to alTop.
However, I thought of another possibility: suppose you have two child components, one to be aligned at the left, another aligned at the top. Then they will fight for ownership of the top-left corner. Experiments seem to suggest that some influence can be obtained by choosing between alTop and alMostLeft alignments for the two controls vs alMostTop and alLeft alignments. I can't see exactly what is going on here, and it's not clear in the documentation. It's also not clear what should/might happen if two child controls are both set to alMostTop.
When you have 2 (or more) controls aligned to top, the alMostTop will be on the top of all others. Same wise with alMostRight, alMostLeft, and alMostBottom.
In Delphi 7 IDE, do the lines need to be a given length? I see a gray line in some Delphi code I'm working with, and it looks like ever line ends right before it.
It's called the right margin. It is intended as a guide to help you avoid writing lines that are too long and exceed your coding standards. You can switch it off from the Editor Options, as I have done here:
It's just a guide to line length. Some people don't like long lines because they can be hard to read on different resolutions or when doing comparisons.
That gray line is called the margin.
You can set its visibility and position in the Editor Properties at the Display tab in the Margin and gutter groupbox.
The margin is a visual assistent. The standard position is 80 characters, which defaults to the maximum unscrolled size of many source formatting output media, such as the one used here at Stack Overflow. Originally, it had something to do with the paper width on (matrix) printers. Maybe it still does.