![]() |
Sizable control in toobar |
Post Reply ![]() |
Author | |
Kenneth ![]() Senior Member ![]() ![]() Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
![]() ![]() ![]() ![]() ![]() Posted: 28 June 2007 at 3:35pm |
Is it possible to place a control such as the CXTPControlEdit in a toolbar and make the horizontal size of that control dependent upon the width of the window containing the control?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
Set xtpFlagControlStretched flag to control.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Kenneth ![]() Senior Member ![]() ![]() Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
![]() ![]() ![]() ![]() ![]() |
Ok, that works. I placed a CComboBoxEx control in a commandbar with: CXTPControlCustom* pControl;
if(lpCreateControl->nID == ID_INPUTDATA) { if(!m_Combo.Create(CBS_DROPDOWN|WS_CHILD,CRect(0,0,126,200),parent,ID_INPUTDATA)) return(FALSE); pControl = CXTPControlCustom::CreateControlCustom(&m_Combo); pControl->SetFlags(xtpFlagManualUpdate); pControl->SetFlags(pControl->GetFlags() | xtpFlagControlStretched); lpCreateControl->pControl = pControl; return(TRUE); }
Now I want to be able to detect when the enter key has been pressed in the combobox edit window. How is this done?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, I recommend you use xtpControlComboBox instead of xtpControlCustom + CComboBoxEx. it supports themes and easy to catch messages etc.
See our CustomThemes sample.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Kenneth ![]() Senior Member ![]() ![]() Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
![]() ![]() ![]() ![]() ![]() |
To our dismay, many of our paying customers insist on using Windows 98 and ME. That means we have to support unicows and unicode on those systems. The xtpControlComboBox does not support the code necessay to work in this environment. Is there any way at all to catch the enter key in a CComboBoxEx edit window and divert to mainfrm for processing when the CComboBoxEx control has been inserted into a command bar as indicated?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Just override CXTComboBoxEx:
class CAddressComboBox : public CXTComboBoxEx
{ BOOL PreTranslateMessage(MSG* pMsg); }; BOOL CAddressComboBox::PreTranslateMessage(MSG* pMsg)
{ if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) { GetOwner()->SendMessage(WM_COMMAND, IDOK); } return CXTComboBoxEx::PreTranslateMessage(pMsg);
} btw what methods/messages are not supported by xtpControlComboBox + Unicows?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Kenneth ![]() Senior Member ![]() ![]() Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
![]() ![]() ![]() ![]() ![]() |
Oleg
If I understand it correctly, we have to be able to do a SendMessage to CComboBoxEx in order to get/set the Unicode text. The SendMessage is of type EM_SETTEXTEX and EM_GETTEXTEX with respective SETTEXTEX and GETTEXTEX codepage parameter set to a unicode codepage (1200).
In additon, the standard CComboBoxEx edit window is replaced with a CRichEditCtrl in order for proper operation on Windows 98/ME.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
CXTPEdit that used by CXTPControlComboxBox is also RichEdit and it also use EM_GETTEXTEX to get text (Always 1200 used) ... so guess it can work with unicows.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Kenneth ![]() Senior Member ![]() ![]() Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
![]() ![]() ![]() ![]() ![]() |
I have a test setup using CXTPControlComboBox and it does not display unicode correctly on Windows 98/ME. When I add some test data to the CXTPControlComboBox list containing 등기우편.com, it works ok on XP but on Windows ME it displays as ????.com. If I use our CComboBoxEx it works ok on both XP and Windows 98/ME. Note that in both cases I have enabled unicows support on Windows 98/ME.
The only difference is with CXTPControlComboBox I have to insert items into the list with AddString() whereas with CComboBoxEX I use the InsertItem() (which is not supported by CXTPControlComboBox as far as I can tell). Any ideas?
BTW, the GetOwner() in your comments above does return the correct parent window. I used AfxGetMainWnd() instead and it works.
|
|
![]() |
|
Kenneth ![]() Senior Member ![]() ![]() Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
![]() ![]() ![]() ![]() ![]() |
Oleg
I am a bit confused about the CXTPControlComboBox. In the standard Microsoft CComboBoxEx control, the display of Unicode on Windows 98/ME using unicows requires the replacement of the standard edit window with one based on richedit. The list box has no problem with the unicode characters.
Why does the CXTPControlCombobox list box have this problem? As you stated, the edit control does support unicode/unicows (although there is some type of font height issue).
Also, does the CXTPControlComboBox support images like the CComboBoxEx?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, CXTPControlCombobox uses RchEdit for edit, but standard system ListBox for List, CComboBoxEx don't use system drawing, but manually draw text/icons for items. Think we will change it too + will add icons support.
I can't test it now with all my Win98/ME - they don't have Japanese, Korean or Chinese languages installed.
ps. You can manully add self drawn list box now that will support unicode - see CustomThemes sample.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Kenneth ![]() Senior Member ![]() ![]() Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
![]() ![]() ![]() ![]() ![]() |
Oleg
When you add the icons/owner draw to CXTPControlComboBox, let me know and I can test it. We do have Windowns Me with Chinese support.
|
|
![]() |
|
Kenneth ![]() Senior Member ![]() ![]() Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
![]() ![]() ![]() ![]() ![]() |
CXTPEdit does use EM_GETTEXTEX to get text if _UNICODE is set however it does not use EM_SETTEXEX to set text, and it appears that I cannot get access to the richedit control to set it myself. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
Call GetEditCtrl() to get pointer to richedit.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Kenneth ![]() Senior Member ![]() ![]() Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
![]() ![]() ![]() ![]() ![]() |
It appears that the CXTPControlCombobox listbox is not unicode/unicows compliant. If I add unicode text to it using AddString, then in the DrawItem function (taken from the CustomThemes example), the following returns a CString that appears to have gone through some type of codepage conversion on Windows 98 as indicated by ??? in the text when drawn using the dc.TextOut function. ((CListBox*)this)->GetText(lpDrawItemStruct->itemID,strText);
Any ideas?
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |