Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Autocomplete droplist needed...
Autocomplete droplist needed... [message #16759] |
Thu, 10 July 2008 09:54 |
kbyte
Messages: 87 Registered: July 2008
|
Member |
|
|
Hi all,
Is there any autocomplete droplist in Upp++?
If not, is it possible to create a win32 combobox in a upp window? I was thinking to use the win32 combo if it is autocomplete.
Could you provide me the code to make a win32 call to some win32 function?
Thank you
Kim
|
|
|
Re: Autocomplete droplist needed... [message #16760 is a reply to message #16759] |
Thu, 10 July 2008 10:27 |
bytefield
Messages: 210 Registered: December 2007
|
Experienced Member |
|
|
Auto-complete is provided by your code not by a widget and there isn't such a widget in Windows nor in U++. You have to inherit from DropList and overwrite Key function (and maybe Paint) and put your auto-complete code in it.
For WINAPI call simply add :: before you function ( ::MessageBox(hwnd, "", "", MB_OK); ). If you're trying to mix U++ with Windows, that's a bit harder because Windows widgets doesn't benefit of U++ positioning, sizing, etc.
cdabbd745f1234c2751ee1f932d1dd75
|
|
|
Re: Autocomplete droplist needed... [message #16762 is a reply to message #16759] |
Thu, 10 July 2008 11:11 |
|
kbyte wrote on Thu, 10 July 2008 03:54 | Hi all,
Is there any autocomplete droplist in Upp++?
If not, is it possible to create a win32 combobox in a upp window? I was thinking to use the win32 combo if it is autocomplete.
Could you provide me the code to make a win32 call to some win32 function?
Thank you
Kim
|
Please use DropGrid - it's similar to DropList and has autosearch. It's not exactely the same what autocomplete but works very good for me. Just focus on DropGrid and start typing. Drop will open and scroll to first matched position (Matched letters will be highlighted). You can jump to the next position pressing F3. Enter close popup and select the focuces item.
|
|
|
|
|
Re: Autocomplete droplist needed... [message #16769 is a reply to message #16767] |
Thu, 10 July 2008 14:18 |
|
cas_ wrote on Thu, 10 July 2008 07:24 | Actually Win32 combobox is able to perform "find as you type" if you make its "SORTED" property true.
Anyway, I found some strange behavior of the DropGrid widget. If you look at the example images, you will notice that the first button to the left side of the DropGrid is always distorted by the usual dropdown icon (a small arrow pointing down), placed right in the middle of the button.
First image is the original DropGrid example, second one shows almost the same, but with the "select" button placed on the right hand side.
|
Thankz I'll check that. It's a linux, right (not a winxp theme) ?
[Updated on: Thu, 10 July 2008 14:21] Report message to a moderator
|
|
|
|
Re: Autocomplete droplist needed... [message #16772 is a reply to message #16771] |
Thu, 10 July 2008 18:13 |
|
as for 1st bug, I don't know why this code (part of MultiButton.cpp):
if(frm) {
if(IsTrivial() && style->usetrivial)
dopaint = false;
ChPaint(w, x, border, cx, sz.cy - 2 * border,
dopaint ? v : style->trivial[st]);
}
on Linux draws background with arrow. Something to check by Mirek..
As for vista. I know. I discussed this with Mirek long time ago. First iteration of Multibutton drawn "real buttons". I don't have vista on my laptop so I can't try to "fix" multibutton. Ide droplist use different paint code. See find window.
|
|
|
|
Re: Autocomplete droplist needed... [message #16774 is a reply to message #16772] |
Thu, 10 July 2008 18:53 |
cas_
Messages: 20 Registered: July 2008 Location: Poland
|
Promising Member |
|
|
unodgs wrote on Thu, 10 July 2008 18:13 |
Ide droplist use different paint code. See find window.
|
Indeed, there is a template called WithDropChoice<> and it renders itself in a very similar way to what DropGrid looks like. So DropList (Multibutton) is the only exception here Vista seems to render its "native" comboboxes in both ways, depending on where you check. For example, Explorer renders the white version, while ODBC source setup uses more button-like look.
[Updated on: Thu, 10 July 2008 18:54] Report message to a moderator
|
|
|
Re: Autocomplete droplist needed... [message #16815 is a reply to message #16772] |
Sun, 13 July 2008 00:13 |
cas_
Messages: 20 Registered: July 2008 Location: Poland
|
Promising Member |
|
|
unodgs wrote on Thu, 10 July 2008 18:13 | (part of MultiButton.cpp):
if(frm) {
if(IsTrivial() && style->usetrivial)
dopaint = false;
ChPaint(w, x, border, cx, sz.cy - 2 * border,
dopaint ? v : style->trivial[st]);
}
|
This has something to do with Chameleon styles. If you add
at line 319 of MultiButton.cpp (so you force Multibutton to use "lmiddle" instead of "left", whatever that means ), the arrow disappears.
UPDATE:
Bug is caused by the MultiButton::StyleFrame() properties, that are set up ChGtk.cpp, lines 1070 - 1080. Somehow, left[i] references an image with an arrow pointing down (I can't find exact place of such assignment though). Unfortunately, I know nothing about Chameleon and I have no idea how to fix it.
[Updated on: Sun, 13 July 2008 23:24] Report message to a moderator
|
|
|
Re: Autocomplete droplist needed... [message #16823 is a reply to message #16815] |
Mon, 14 July 2008 23:53 |
cas_
Messages: 20 Registered: July 2008 Location: Poland
|
Promising Member |
|
|
Problem dissapears if I comment out line 928 of ChGtk.cpp (altough in this case left frame becomes a bit too thick):
DropList::Style& s = DropList::StyleFrame().Write();
GtkChImgWith(s.look, CtrlsImg::DA(), 1 * q, po);
GtkChImgWith(s.trivial, CtrlsImg::DA(), 1 * q, po);
// GtkChImgWith(s.left, CtrlsImg::DA(), 2 * q, po);
GtkChImgWith(s.right, CtrlsImg::DA(), 1 * q, po);
s.pressoffset = po;
This is because DropList::StyleFrame() and MultiButton::StyleFrame() are the same, so changing one of them will also change the other.
I still don't know what the correct solution would be and why is CtrlsImg::DA() used in so many contexts (actually I wonder about many different things in here but that's another story ).
|
|
|
|
|
Re: Autocomplete droplist needed... [message #16875 is a reply to message #16774] |
Fri, 18 July 2008 21:39 |
|
mirek
Messages: 13979 Registered: November 2005
|
Ultimate Member |
|
|
cas_ wrote on Thu, 10 July 2008 12:53 |
unodgs wrote on Thu, 10 July 2008 18:13 |
Ide droplist use different paint code. See find window.
|
Indeed, there is a template called WithDropChoice<> and it renders itself in a very similar way to what DropGrid looks like. So DropList (Multibutton) is the only exception here Vista seems to render its "native" comboboxes in both ways, depending on where you check. For example, Explorer renders the white version, while ODBC source setup uses more button-like look.
|
Well, in fact, I have observed (and reproduced, was quite hard work BTW, in fact the whole MultiButton class is dedicated to this purpose) this Vista rule:
If you can edit the content of field, buttons are white and become visible on hover.
Otherwise they are button-like - but in that case, the content is button-like too.
Mirek
|
|
|
Goto Forum:
Current Time: Mon May 13 09:25:51 CEST 2024
Total time taken to generate the page: 0.02654 seconds
|