Motif 1.2 X11 on using RowColumn widget inside a ScrolledWindow - c

I have a Motif client (running it on Linux). The client displays an array of buttons to the user in a tabular fashion. Obvious choice is the RowColumn widget. I want scrollbars around the array of buttons so I created a ScrolledWidget and place the RowColumn widget inside. I also place a Frame widget around the Row column widget to make it stand out.
Now, the problem. I want to put a button OUTSIDE the array of widgets for Quit. Problem is it not displaying the button. Is this doable?
Any sample code to do this is appreciated.

XmForm contains:
XmPushButton (exit)
XmScrolledWindow contains:
XmFrame contains
XmRowColumn contains:
array of XmPushButtons
Set up the connections for the XmForm to place the exit button and scrolled window appropriately.

Related

Combo box in a MFC application

My question is about combo boxes in Windows MFC applications.
The dropdown part of the combo box contains items composed of a bitmap and a string.
Sometimes, the strings are too long and I have to adjust the width of the dropdown part of the combo box using the CComboBox::SetDroppedWidth() method.
My problem is that when the combo box is near the right edge of the computer screen, the right part of the dropdown is hidden (see image_1 and image_2 below).
I would like it to behave like in Excel (see image_3 below) meaning I would like the dropdown list to be shifted accordingly so that all its items can be seen without being cropped.
How can this be achieved?
image_1: right part of the dropdown is NOT hidden
image_2: near the computer right edge, the right part of the dropdown is hidden
image_3: Excel combo box
=================================================================
EDIT 1
=================================================================
EDIT 2
Ok. I forgot to mention that m_cbXmodels is a CComboBoxEx object. This is why the handles are NULL. I could get the handles via GetComboBoxCtrl()...
Handle the CBN_DROPDOWN notification.
Get the handle for the list control with GetComboBoxInfo.
Now use MoveWindow to adjust the window as needed.
Getting the current screen size is available with MonitorFromWindow. See rcWork member in MONITORINFO. You just need to adjust the left and right coordinates.
EDIT: As you can read in the comments: My Approach with CBN_DROPDOWN is to early Thanks to zett42). It is not possible to resize the combo box list part here.
But it is possible to post a user defined message to the same window and to reposition the window than.

Gtk3.0 Overlay with Labels on DrawingArea

I have created a small gtk application that displays an RTP stream in a gtk window. I am also displaying information on top of this video by using the textoverlay element provided by gstreamer. This feels like a back door since it appears to be intended for subtitles.
I would like to display my information using methods provided by gtk. I am currently trying to use the overlay container to hold the drawing area created for the video and then placing a layout container on top of that holding labels.
I am finding that the background of the layout container is being drawn on top of the drawing area, meaning blocked. If I remove the drawing area and use two layout containers with labels in them, overlapping labels are displayed the way that I would expect.
I have tried various combinations of opacity and containers with no luck.

Codenameone list scrollbar quetions

I have a list and its scroll bar on the right along with two custom buttons representing upscroll and downscroll. These two buttons simulate scrolling by using list.setSelectedIndex(index, true) and are placed above and below my scrollbar via my custom layout.
I have two questions regarding this:
1). Since the upscroll and downscroll buttons are overlayed on top of the list, they disappear when i click elsewhere..and they kind of flash into appearance when i click the area it's supposed to be in. How can I remedy this behavior?
2). I have a scrollbar image that I have used in the "Scroll" theme in the GUI builder. It's alignment is IMAGE_ALIGNED_CENTER. However the scroll thumb doesn't reach the end of the bar when i scroll to the end of the list via my upscroll and downscroll buttons. The upscroll and downscroll buttons essentially scroll the list by one index with each press (using setSelectedIndex(index, true)).
Thanks
How do you overlay the buttons. I'm assuming you just set them into a specific location which disallowed as we can't possibly adapt them to the various resolutions. I suggest reading the developer guide section on layouts very carefully.
To place something on top of the list in a portable way you need to use the LayeredLayout or the LayeredPane and a Container + correct layout to position this within (e.g. BorderLayout EAST).
In this blog post there is a sample for making a scrollbar but it isn't "on top". It can be used as a starting point.

How could I interactively create an invoice and preview it on WPF?

I'm creating a trial project wherein my window has two grids, left grid is sort of a table that has labels and textboxes each row and asks for a specific part of the invoice like item, name, address stuff like that and the right grid is to show a preview of the invoice that the left side is creating.
I thought about using a document viewer on the right side but I thought that anything I open there would be static and if I put values on the textboxes on the left grid, it wouldn't matter since I opened a standalone document to view on the right grid.
I thought about just creating a table out of the right grid and have the default values and populate the other ones when a user types something on the textbox and make it function as the preview but then I don't know how would I go about and printing it and also, it has about 45 rows which I couldn't fit in the grid without it being unreadable (because I had to cram 45 rows of data inside that small grid)
So is there a tool in the toolbox that could potentially create a interact-able grid? I tried the grid control but I can't seem to only make it show 4 columns because that's all I need, I don't want it to show E and the rest of the alphabet because I want it to resize accordingly with only 4 columns to make it more readable.
Oh and I also have devexpress installed so you guys could also recommend something I can use from there. Thank You.
I think this is the best solution since it does what I wanted it to do.
I created a scroll view and placed a grid inside it then set the length accordingly to show it in a reasonable size and let the scroll bar do its magic for me to see the rest of the grid without compromises of the content's size.

How to Move content to next page in WPF Form

I am new in WPF if there is something wrong please co-operate.Here i require some idea from experts.
I am working on one application in which i have to show some content on WPF form after filling the fields present on the form.On the same form i also have a print option.
Check this image.This is my form here part in the red block is generated at runtime.When i click on the print button it only show the visible part on the paper and skip the remaining part.
Problem :
How i can move the remaining part of the form which is under scroll to next page when i click on print.
For example in the given image we can see only 2 bulls eye completely and next 2 partially.How i can shift this remaining part to next page only when i click on print.
The answer is quite easy : don't rely on your window to do the printing, but build the visual you want then print it.
For instance, you must have a function that creates dynamically the circles and so on, then adds them to a Panel. What you might do is to print the Panel.
Or if you prefer, you might build Dynamically a new window, where you put all the Data you want printed as you want, then print the window. The advantage of this method is that it is more flexible for the content (if you want a header/footer) and also you can watch the content easily for debug. Note that even if the Window content is dynamic, you can have a base window for printing that avoids you to do too much xaml with code (expl : you might have TextBox bound to a PrintTitle property that you setup in the constructor of the Print Window...).
Notice that visual that were not rendered on screen will not print. Be sure, to avoid the common issues, to have a look at this article from this great site, switch on the code, here :
http://www.switchonthecode.com/tutorials/printing-in-wpf
Edit (reply to the question in comment):
1) If you have fixed number of bulls eyes, just make one Window for that number and Print it, this is waaaay easier.
2) To put Visuals in pages instead of rows, you'll have to rely on page Width/Height. What matters is the size of your control vs size of page. In the example, they build (in OnRender) Controls having LineHeight, LineWidth as size. Do the same : Try to put as many line of control as you can such as
(Control Height + margin )*NumberOfControlPerPage < Page Height.
Then you have to change OnRender to render controls instead of Rows made with rectangle+text. Pack your controls two by two in Horizontal StackPanels Then pack those StackPanel into a vertical StackPanel, then render. You have to keep track for each page which control was rendered last, then resume rendering at the following control.
Please follow this link.This is the basic which i got after searching in web world.Using this basic detail you can do any thing with print in WPF

Resources