I have a spark List with horizontal layout and custom ItemRenderer.
Each ItemRenderer has a width=80px. But it may contain graphic objects (s:Rect for example) with more than 80px width.
After compiling it looks like "overflow:hidden". But i need something like "overflow:visible" for my renderers and to see full size of my rectangles and other objects.
How to prevent the cutting of overflowed width and to display whole objects with overlapping?
Set clipAndEnableScrolling=false on the itemRenderer.
You can also just use a DataGroup, which allows you to use any layout you please.
Related
I have a bunch of items I want to display in a grid. I'd like the grid to dynamically resize based on the terminal window size. Basically I'd like it to fit as many columns as possible before adding another row. How should I go about this? Is the CDK matrix the right widget to use for this?
short: no
long: there are several points
CDK does not do any re-layout when reading KEY_RESIZE.
The matrix widget has no methods for adding or removing rows/columns.
While CDK allows binding of keys to callbacks, that probably does not work for special keys such as KEY_RESIZE.
You wouldn't be able to re-create (i.e., "resize") a matrix widget using a callback.
Rather, you might use the CDK widget as a starting point and see how to modify it to address the limitations noted above.
Whenever I render a text using text layout object, it's apparent that actual width of text is not same as the width of layout depending on enable option in text wrapping.
I would like to know if there is anyway I could do to set width and layout width to be the same?
So When I pass in width and height in a creation of text layout object, I want it to render the text in the exact dimension I provided.
Initial layout dimensions are used to control word wrapping or trimming, if enabled. So it depends on what you want to achieve, normally you set desired layout box, and text does not have to fit or fully fill to any degree. When rendering you might be interested in effective rectangle that your text fits in fully, you need to call GetMetrics for that, and use returned DWRITE_TEXT_METRICS struct fields. Metrics data will contain actual rectangle sizes for your text, regardless of what you specified on layout creation.
I would like to create a custom widget in QT that is, essentially, a grid. I would like to allow this widget to be resized, but only so long as all boxes in the grid are of the same width and height. For example, if the grid is 30x20, then the widget need only be able to have widths that divide by 30 and heights that divide by 20.
I did not find anything in the size policy that seems like what I'm trying to do.
I know that X11 does support such size policies. Then again, it also supports defining aspect ratio ranges for top level windows, so that does not, necessarily, mean that Qt supports it too :-)
I know I can catch the resize signal, and then round down the size given. I think this might have unpleasant effects if used inside a broader layout, though. For example, placing two of those one next to the other might cause an infinite loop.
Thanks,
Shachar
i need to add in list components that are not equal in height, is there a way for it to work?
Different cell heights within a list are not supported by LWUIT. The list takes care and resizes all cells to the size of the largest one.
Thought about different renderers (e.g. fisheye renderer link) for different components if you need to alter , even thought the cell height stays the same for the whole list.
Use the ContainerList class which is a part of LWUIT 1.5 and Codename One.
You can use your component which extends from container and add those components in a Container which has BoxLayout.Y axis as its layout so that all the list items will have height according to the text that you added. How many items do you want to add?
In my MFC program,I want to display different size images in a list!
I use CListCtrl and CImageList!
But the CImageList only can load fixed images!
Variable row heights in CListCtrl is not supported. You could take a look at this article that describes a control based on CWnd that handles drawing of variable row heights.
I would consider to use the so called "owner drawn" mode to draw these myself. I don't know about another option (there is no built-in mode)... Maybe you can also take the biggest size and fit the smaller images into the bigger frames but I think it will be the same effort and be less efficient...
I mean use the
CListCtrl::DrawItem()
method
Create a "grid," a non-symmetrical grid most likely, on a dialog or Form. Then populate it with irregular shaped images as you choose. If you need more space look into a Scrollable “whatever,” view, dialog, etc.
Irregular or non rectangular shaped bitmaps seems a good place to start.