Home » Developing U++ » UppHub » PopEasy
Re: PopEasy [message #36512 is a reply to message #36500] |
Sun, 03 June 2012 22:56 |
Lance
Messages: 526 Registered: March 2007
|
Contributor |
|
|
Main motivation:
In database application, a typical requirement we frequently have is some kind of Ctrl (or group of Ctrls) that do key-value conversion. Eg, you (or users of your application) will key in some text in certain area intended for an inventory item, and your application can search database in whatever way you decided for all matching inventory items; these items are subsequently presented to user. He/she may select one either with key stroke or mouse, or he/she may keep on typing until the list is short enough. And when a choice is finally made, a user friendly text will be displayed and the associated iventory item id (of integral type) is be provided to the application for subseqent processing.
DropGrid with search-hide-row is a closest match. I have been using it extensively. DropGrid, however, like DropChoice, DropTree, will own the keyboard focus in its session. This make editing not always as natural as we would like. For example, I need to do some interesting things with all inventory items containing "fatastic", one at a time. Let's say I have 10 items containing this text. With DropGrid, I need to key in "fatasic" for 10 times. Why couldn't I just type it once, copy it in the clipboard, and paste it for the subsequent 9 times? I might be wrong in DropGrid's not accepting Ctrl-V, but you'll definitely find situations you would rather work with a real edit ctrl, be it EditField derivative, EditLine, or RichEdit.
For that purpose, the popup should not take focus away from the main ctrl (the ctrl the popup will work for. In Ctrl::PopUp(...), it's called the *owner*). I did some experiment, and fixed some issue associated with that.
One of it happens when the main window is resized or moved. Resize'ing or move'ing will not trigger main's lost-focus event, we end up have a popup detached from its owner. BTW, theide's CodeCompletion, which is the best among the open-source ones (second only to Visual Studio and possibly a couple of other commercial ides), uses the same approach that would-be PopEasy uses: a non-focus popup with the focused editor. Theide's popup will no respond to size/move. If you bring up a PopUp and then resize or move theide, you'll found the popup detached from the location it's giving options for. Anyway, after some research, I find it can be handled nicely with UPP's built-in capability: just use the State virtual method.
Another issue I encountered is a visibility issue. I use TabBarCtrl to provide a multi-tab user interface similar to FireFox. If I bring up a popup for a ctrl and switch to another tab, the popup becomes detached and clueless as its owner remains focused and doesn't have a size/position change. To fix this issue, I decide to unpop the popup when its owner becomes invisible. This is a very dubious decision because it prohibits the popup from covering its owner which is theoretically wrong. But for now, it doesn't seem to be so much a problem and promises an easy fix.
[Updated on: Sun, 03 June 2012 23:23] Report message to a moderator
|
|
|
|
|
PopEasy
By: Lance on Fri, 01 June 2012 16:33
|
|
|
Re: PopEasy
By: koldo on Sat, 02 June 2012 14:25
|
|
|
Re: PopEasy
By: omari on Sat, 02 June 2012 19:51
|
|
|
Re: PopEasy
By: Lance on Sun, 03 June 2012 01:16
|
|
|
Re: PopEasy
By: Lance on Sun, 03 June 2012 01:28
|
|
|
Re: PopEasy
By: Lance on Sun, 03 June 2012 01:45
|
|
|
Re: PopEasy
By: Lance on Sun, 03 June 2012 03:26
|
|
|
Re: PopEasy
By: Lance on Sun, 03 June 2012 22:56
|
|
|
Re: PopEasy
By: koldo on Mon, 04 June 2012 15:34
|
|
|
Re: PopEasy
By: Lance on Mon, 04 June 2012 18:01
|
|
|
Re: PopEasy
By: Lance on Wed, 06 June 2012 17:29
|
|
|
Re: PopEasy
By: koldo on Wed, 06 June 2012 18:17
|
|
|
Re: PopEasy
By: Lance on Wed, 06 June 2012 19:00
|
|
|
Re: PopEasy
By: Lance on Thu, 07 June 2012 04:48
|
Goto Forum:
Current Time: Sun Apr 28 00:37:02 CEST 2024
Total time taken to generate the page: 0.03789 seconds
|