Trim text in a table column header with sort indicator - c++

I have a table with styled column headers.
Header height is limited so the headers are actually narrow.
The header has also the sort indicator (the default arrow/triangle).
When the user changes the width of a column such that it is smaller than the text's width, the text is trimmed with 3 dots at the end. E.g. "Universi..."
So far so good.
The thing is the sort indicator hides part of the trimmed text.
Imagine wide column - the text is fully show and the sort icon is on the right and everthing looks good. Now the user resizes the column. Just before the text is trimmed with 3 dots, the sort indicator starts to hide the right side of the text. At some point the text is trimmed with the sort indicator on top of the 3 dots . E.g. "Universi.▽" or even "Univers▽".
It looks like the header does not take into account the sort sign.
Is there a simple way to set the sign indicator to not overlap the trimmed text e.g. "Univer... ▽"?
I need the columns to be resizable and sortable.
I don't want to define a special widget with push button and text box and handle events and trimming and so... it is a serious overhead.
Thanks

This is a bug https://bugreports.qt.io/browse/QTBUG-629
Which should be solved in Qt 5.4 https://codereview.qt-project.org/#/c/99900/

Related

Remove space between Oracle APEX page items

I have created two APEX checkbox items on top of each other, one being the checkbox selections (complete, incomplete) and one being a select all option above it (with associated JavaScript to enable the select all functionality). Everything works great, but I am trying to remove the white space in between the page items.
The checkbox item with the selections has no label because the Select All item has the heading for both items to be treated as "one item" to the user. I think the template might still be accounting for the label padding, but I'm not sure.
Does anyone know a solution in order to remove the white space (I'd be find with a small amount of white space but right now it is very large and doesn't look visually appealing.
Open up the template options, and set the desired margin attributes to 'None'

ListView32 - re-adding column doesn't restore data

I'm implementing show/hide column behaviour in a standard C++ Win32 application (no frameworks).
Say we've got 3 columns in a ListView control in Details view. The user has the option to show/hide the last two columns in order to see the extra detail if wanted or hide them to reduce clutter. All works well except that after the columns are deleted and then re-added, the data from the sub-items in those columns doesn't show up again, i.e. the columns are empty.
None of the items themselves have been altered in the meantime - do I lose the sub-item text when I delete the columns or I am missing something to force the columns to redraw the data?
Steps to reproduce:
1) Create a ListView32 control with 3 columns and add a bunch of items (and text to each of the items' sub-items). All good.
2) The user clicks "Hide Details", so I use LVM_DELETECOLUMN twice to remove the last two columns and they disappear. All good.
3) The user clicks "Show Details", so I use LVM_INSERTCOLUMN to add the last two columns and the headings appear, but the columns themselves are empty.
As an alternative, setting the column widths to zero is a hack and the user can still grab the re-size column splitter, so it's not a great option.
Many thanks for any suggestions.
Typically one does not store data in GUI. In case of plain listview32 you should add items specifying LPSTR_TEXTCALLBACK instead of real text and then handle LVN_GETDISPINFOW notification supplying (sub)item data. Windows will send this notification for all items. You can force Windows to retrieve data again by sending LVM_UPDATE message.
Setting the column widths is a viable solution. That is the way I do it in my UIs when columns can be shown and hidden dynamically. It works fine.
To prevent the user from resizing "hidden" columns, simply subclass the ListView using SetWindowLongPtr(GWL_WNDPROC) or SetWindowSubclass() to intercept HDN_BEGINTRACK notifications from the ListView's header control:
Notifies a header control's parent window that the user has begun dragging a divider in the control (that is, the user has pressed the left mouse button while the mouse cursor is on a divider in the header control). This notification code is sent in the form of a WM_NOTIFY message.
...
Returns FALSE to allow tracking of the divider, or TRUE to prevent tracking.

ColdFusion - POI setCellStyle without affecting it's existing style?

I have a cellStyle created for the Excel file to have row striping. I also want to set any cells with numeric values to RIGHT ALIGN. I can accomplish this by checking the value of the cell, and if numeric I setCellStyle(styleRightAlign) where styleRightAlign is the name of my right align cellStyle.
However, this overrides the existing style and my cell no longer has the correct background color. It's right aligned correctly, but how can I just "add" a cell style rather than override the existing?
Is this possible?
I've looked at using the CellUtil setCellStyleProperty method but I'm unsure how to create an instance of this in ColdFusion, and if it is what I need for this.
UPDATE
So it looks like CF 11+ have the CellUtil available, but CF 10 does not. Figures. So I'm creating a separate style with my row striping for alignRight that includes the background color. If anyone has any ideas how I can just align the cell without affecting the existing cellStyle on it, I'd love to hear it.

Notepad++ How do I insert a column of data?

So I am trying to take a column of text data and replace that data with edited information. I am trying to manipulate values in a fixed width file. I want to leave the rows intact. I know I can hold ALT and select a whole column of information but when I try to paste into the selected area Notepad++ just adds the information above the first row and deletes the column Ive selected. Please help, I have been researching for a while now and cant find anything on this.
Below I will try to explain a bit better, if I were to select the asterisks using Alt+mouse and I have a column of data that I have copied from another file how could I replace the asterisks but leave the other data intact?
1111122222**22233333333333
1111122222**22222223333333
1111111122**22222223333333
If I understand the question correctly, you have copied the column of data from somewhere else and want to copy it as a column into notepad++. If you simply select a column in your notepad++ document and try to replace it with the external column, you will get many copies of that column. The trick is to first paste your column into an empty document (or into new lines in an existing document), then select that column you just pasted in but make sure you select it in column mode, i.e., while holding down the Alt key, and then copy it with Ctrl-C. Now you can column-select the column you want to replace and copy in your copied column with Ctrl-V
You can use ALT + Mouse to select the columns to copy the data and replace it. This animated gif is self explanatory.
If I understand your question correctly, you want to paste a certain text in front of all columns you've selected ?
Either use ALT + Mouse or SHIFT + ALT + up/down arrow to select the desired number of columns.
Either use ALT + C or Menu Edit -> Column Editor to enter the Column Editor.
Fill in the "Text to Insert" and press Ok.
Good luck !
Edit: as pointed out in the comment, this is actually answered in Notepad++ How to paste string across multiple lines
ALT+Mouse works alright for me. I was able to replace the asterisks with other charactes. Maybe we have diferent versions? I don't think so, though.
Make sure you are also using Alt+Mouse when you select the information you want to copy. Not only when you paste it.
I hope that helps you.
Good luck!
Replacing a column with new data is easy:
Hold ALT + select with your mouse the column (you already did that)
Press DELETE or CTRL + X to remove the old column
Leave the cursor flickering in the same position (or wherever you want to add the new column)
Paste CTRL + V
Note: you must NOT have your column selected when pasting. I think that's what confused you.
Copy required text(columns) with Shift+alt and mouse (or arrows), then paste as required with ctrl+v.

Up and Down icons in CListCtrl

I have a CListCtrl with multiple columns, all of which are able to be sorted by. I would like to add up and down icons so that it is clear which column is currently sorted upon, and in which direction; much like Windows Explorer. My thought was to add a solid up/down arrow to the column name. I tried using the extended ASCII chars 30/31; but instead of showing the arrows, I got boxes (the "character not found" character); and using the unicode version, I got a question mark instead of the character.
Any suggestions as to how I could accomplish this?
You can use the newer CMFCListCtrl class or the CMFCHeaderCtrl class. There, you can set the sort column and the sort direction.
Try
myListCtrl.SetSortColumn(nCol, bAscending);
or
CMFCHeaderCtrl &headerCntrl = myListCtrl.GetHeaderCtrl();
headerCntrl.SetSortColumn(nCol, bAscending);