Lookup Combo that supports remote data - load data only after user wants to - c++

I'm building a VCL c++ builder application. I would like to see if anyone knows of a component that can load data in the lookup upon drop down only after a user has typed a few letters to limit the rows queried? Preferably after pressing Tab, or Enter.
What I would like best is to get a behaviour similar to what Linux command line has, but that might be wishful thinking. The way it would work is to drop down the combo list after user presses tab only if there is multiple options available, and to fill in additional text till the point where characters are not the same anymore, then if user presses tab again, drop down list.
The next best would be if the drop down would only allow drop down if user has typed a few letters, then pressing a specific button opens the dataset with the parameter of the typed text so far, then drops down the combo.
Does a component like this exist?

You can check out TMS Software. I'm not sure if it has something exactly for you, but their components are quite flexible. And you can send a feature request to them - to consider for next update. If you are lucky they might add it to next release.

Related

How to ask input from a QML Dialog multiple times?

I am not very experienced with Qt and I have trouble doing what I want.
In my application, I search for archive files with password on a disk (that part works) and I want to ask the user for the password each time I find one new encrypted archive.
If I find multiple files while user hasn't given any password, I want the dialog for the first password to stay visible until that password is given and then the dialog for the next password can show and so on.
I use some sort of queue to remember which archives need a password, and I am trying to show and hide an unique dialog (actually a Popup) with the info of each archive and get the password from a TextField inside. In the meantime my application is doing other stuff in the c++ code like searching for archives and extracting them when a given password is OK.
My problem is that it is not really working. The dialog shows the first time, I get the first password but then the dialog doesn't show for the next password. Sometimes I can see the dialog a second time, for a few milliseconds, before it disappears without user interaction. My application is blocked because it cannot go on without the unasked passwords.
I get that I am doing something wrong but I don't get what exactly.
Can anyone help ?
I don't know if I was very clear, English is (obviously) not my mother tongue.
I found my mistake.
I did a component based on a Popup.
Inside the onClicked function of the Check or Skip buttons I was doing two things: send accepted() or refused() to trigger custom actions and then close the dialog.
I was doing that in that order, so the accepted or refused action, which among others things triggered the visibility for the "next" password dialog, occurred before the close event, which was setting the dialog visibility to false.
I switched the order and it's way better.
I feel a little silly now but at least I found it.

How to look for a specific mapping in the navigator window

I'm new to powercenter and the learning curve of this tool seems to be different from the programming languages I'm used to. Where I work everyone tells me to ask people in the office. Access to the internet is non existant. Stack overflow is one of the few places where I can look for info.
I would like to do something basic like, in the navigator window, there are sometimes thousands of mappings with veeeery similar names, I would like to know if there is a way to enable a "control-f" type of functionality. As of right now, placing the mouse on the window and writing the name kinda helps, but since the names are stuff like
k_l_ll_sigpir_proyectname_mappingname
and there are dozens and hundreds that share the same structure: "k_l_ll_sigpir_" trying to navigate when you don't know where info is other than the name is a bit of a nightmare, compared to other tools at least.
Can someone point me in the right direction? Thanks in advance.
I guess I was able to find something that might help, although this is a bit counter-intuitive. I'm assuming you want to find and open some mapping in Mapping Designer. Here goes:
After you've connected to Repository and have the right folder opened (not just connected!), choose Tools => Queries from the menu bar. A Query Browser should open for you.
Choose New to create a new query
In the Query Editor there's a grid. Choose Object Name in the Parameter Name column. Change the Operator to Contains and put whatever you're looking for as Value 1 (using your example: mappingname)
Click the blue play button on the menu bar or choose Query => Execute from top menu. Give this a few seconds.
Give it a few more seconds...
A Query Results window should be opened for you. NOTE: if you've been clicking anything it might get opened in the background - just check the Designer button on Start Bar. It should contain all the objects that contain mappingname string it the name. We've not limited this to mappings only though (I'll discuss this below).
=== now here's the odd part ===
You can right click any item on the list in Query Results window and choose Open in Workspace. And it won't work :)
Switch back to Query Editor window and close it (don't close the Query Results!). You may save you'r query if you like to.
You should be back at Query Browser. Close it.
Return to Query Results.
Right click the desired item and choose Open in Workspace.
Voila!
Now some remarks:
The whole repository is searched. The Query Results may therefore contain items from other folders, than the one you have open. Trying to Open in Workspace such objects won't work since the folder is not open in Designer.
You may construct more sophisticated queries. Just click 'Add new...' icon on the Query Editor window. This will add a line and allow you to choose extra conditions. It will be spawned by a AND condition which you may change to OR. You get the idea.
PS.
Yes, it's odd, I know. Just don't blame me ;)
The quick answer is that the 'metadata manager' tool can do exactly what you ask for. It is basically a 'google search' for your entire data warehouse. Only hiccup is that it requires a lot of work from the admins of your power center servers to get it up and running...
Alternatives:
Basically it depends on what you want to DO with the mapping after you've found it and why you look for it in the first place:
1) in the 'designer tool' you can look under 'targets' in the right hand tree structure
- when you've found the target table you want the mappings for
- simply right-click and choose 'dependencies'
- in the following dialog uncheck everything except 'mappings'
- in the following right click on the most likely mapping and choose 'open in workspace'
2) in the repository database there is a view called opb_task_inst_run that contains a row for each session that has ever run. You can write simple sql against that view with '%like patterns%' to locate mappings... you may want to add a where clause to 'start time' for the most recent week or so - especially if the repository is old and runtime metadata has never been deleted...
Please write back if you need something different...
I'm not aware of the functionality you're after within informatica, however, the mappings are listed in alphanumeric order which should alleviate this. Within the mapping itself there is search functionality to find transformations within the mapping.
As far as a place to start learning Informatica, informatica tv is one place to get your feet wet https://network.informatica.com/support-videos.jspa

MFC "Hidden" or "Default" Function Key Accelerators?

I have a pretty normal MFC SDI application.
I recently started using things from the new MFC feature pack (eg CMFCToolbar), and after all these changes, I am seeing some unexplained behavior in keyboard shortcuts.
It seems some resource IDs have function key shortcuts (like F6), but I cannot find out how this works, or how to disable it.
For example, if I mouseover ID_ABC in a toolbar, I see a tooltip like:
ABC (F2)
Do ABC action
I don't see VK_F2 anywhere in the accelerator table, or anywhere at all for that matter. I also cannot find (F2) anywhere at all in the solution. This all seems very weird to me. Pressing F2 does indeed do ABC.
If I delete the entire accelerator table, that seems to "fix" the problem, but then of course I have no accelerators. As soon as I add any accelerator back, the problem re-appears.
Usually, when I run into these things, I seem to be on my own, and the cause of the problem is usually "far away", sort of like landing in some random function after a bad memory access, and saying, "why am I here"??
But if anyone knows anything about this, thanks!
Just look into the accelerator table in the resource file of your application. Yes, many standard commands do have accelerator keys assigned (eg Ctlr+S is mapped to the File Save command). You can delete the commands you do not want (individually, not the whole accelerator table). The application "remembering" the old accelerator table assignments (or not working with the new ones) may be due to saving these in the registry. Go there and delete the "Workspace" tree for your application, and then test anew.
Menu item labels must contain the shortcut as well, separated by a tab (eg File &Open\tCtlr+O). Status bar hints and tooltips are created by a string resource, with the same ID as the menu or toolbar item. You can create/edit these in the Menu Editor or the String Table Editor. The two items are separated by a newline character.

Command pattern for undo/redo: when to NOT merge undo commands?

I'm implementing an undo/redo feature in our graphical Qt5-based app, using QUndoCommands which have a nice mergeWith() feature: for example, if the user repeatedly clicks the font size increase button on my app, rather than creating a ton of commands in the undo list, it just updates one command on the QUndoStack. So a single undo will go back to the original font size.
That's great, but there are times I don't want to automatically merge commands. For example, if I drag an item to a new location and drop it there, then drag the same item to another location: my app should create 2 move commands, not merge them both into one command.
So, here's a list of events that I think create a logical break, where the user will expect a command NOT to be merged with the next command, even if the next command changes the same property of the same object:
mouse release
widget lose focus
timer (after ??? seconds)
text typing, after ??? characters (or this can be handled with the timer?)
text typing, after certain keys are pressed, such as backspace?
As indicated by the question marks in my list, I'm not really sure in what situations to suppress merging commands. So my question is, are there any best practices in this regard? Where can I find them?
FWIW, I did not find any best practices, but for my software I suppressed merges on focus change (which in my app also occurs on mouse release on the graphics part). Additionally, for typing, I suppress merges if the input position changes in a way other that as expected for deleting or typing 1 character, and if the user switches between deleting characters and typing characters.
I did not bother with the timer, or with maximum characters when typing.

Unlimited number of checkboxes

I wonder how to create mechanism which create new checkbox below previous when you click on button. Number of checkboxes are unlimited.
I don't think that table of objects work well, so I think about implementation in list of objects.
Any suggestions?
Here is what I would do:
Create an event for clicking that button (let's call it OnBtnClick)
Use a vector/list to hold all the checkboxes
When OnBtnClick is called you do:
create a checkbox with the desired position and size and make sure it receives an unique id (this will help you differentiate between checkboxes when they are clicked/checked/etc).
add the checkbox to the list (to get its status: checked or not checked)
add the checkbox to the desired window, the parent window (though this may happen automatically when you create it)
if you want to add an event for the added checkbox you should check the manual of your GUI framework (you will probably use the same event handler for all checkboxes and treat them separately based on their id)
Depending on the GUI framework used the bottom details may vary but the idea remains the same. I did this with wxWidgets, QT and MFC but I don't know which framework you use. You should be able to find code samples for each framework.
What would you do with unlimited number of check boxes - confuse the user? So, that he/she wouldn't attempt to use it again? Bad idea, as you can guess now.
You may (should) limit the number of check boxes (or better, limit the number of controls on form/dialog). IMO, more than 10-12 CBs would be cumbersome for the end user. Therefore, better idea is to have all of them on dialog/dialog-resource, and make all of them invisible/disabled. When user does some action, make them visible/enabled - so that end user may do something with it.
Still demand N number of CBs, where N is not determined beforehand? Then you may have checkboxes under Combo box, or use check-boxes under List Control. List Control already hosts this feature, but for CBs under Combo, you may need to write your own class.See this article as an example.