Implementing some more controls and an MDI child frame fix for wxFrame.
Also include the textbuf class in the make. New module definition file. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
fb49f3b32e
commit
0cf6acbf26
@ -22,74 +22,105 @@
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
||||
|
||||
bool wxChoice::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n, const wxString choices[],
|
||||
long style,
|
||||
bool wxChoice::Create(
|
||||
wxWindow* pParent
|
||||
, wxWindowID vId
|
||||
, const wxPoint& rPos
|
||||
, const wxSize& rSize
|
||||
, int n
|
||||
, const wxString asChoices[]
|
||||
, long lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator,
|
||||
, const wxValidator& rValidator
|
||||
#endif
|
||||
const wxString& name)
|
||||
, const wxString& rsName
|
||||
)
|
||||
{
|
||||
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
|
||||
return FALSE;
|
||||
// TODO:
|
||||
/*
|
||||
long msStyle = WS_CHILD | CBS_DROPDOWNLIST | WS_TABSTOP | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL;
|
||||
if ( style & wxCB_SORT )
|
||||
msStyle |= CBS_SORT;
|
||||
long lSstyle;
|
||||
|
||||
// the experience shows that wxChoice vs. wxComboBox distinction confuses
|
||||
// quite a few people - try to help them
|
||||
wxASSERT_MSG( !(style & wxCB_DROPDOWN) &&
|
||||
!(style & wxCB_READONLY) &&
|
||||
!(style & wxCB_SIMPLE),
|
||||
if (!OS2CreateControl( pParent
|
||||
,vId
|
||||
,rPos
|
||||
,rSize
|
||||
,lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
,rValidator
|
||||
#endif
|
||||
,rsName
|
||||
))
|
||||
return FALSE;
|
||||
lSstyle = CBS_DROPDOWNLIST |
|
||||
WS_TABSTOP |
|
||||
WS_VISIBLE;
|
||||
|
||||
if (lStyle & wxCLIP_SIBLINGS )
|
||||
lSstyle |= WS_CLIPSIBLINGS;
|
||||
|
||||
wxASSERT_MSG( !(lStyle & wxCB_DROPDOWN) &&
|
||||
!(lStyle & wxCB_READONLY) &&
|
||||
!(lStyle & wxCB_SIMPLE),
|
||||
wxT("this style flag is ignored by wxChoice, you "
|
||||
"probably want to use a wxComboBox") );
|
||||
|
||||
if ( !OS2CreateControl(wxT("COMBOBOX"), msStyle) )
|
||||
if (!OS2CreateControl( wxT("COMBOBOX")
|
||||
,lSstyle
|
||||
))
|
||||
return FALSE;
|
||||
|
||||
for ( int i = 0; i < n; i++ )
|
||||
//
|
||||
// A choice/combobox normally has a white background (or other, depending
|
||||
// on global settings) rather than inheriting the parent's background colour.
|
||||
//
|
||||
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
Append(choices[i]);
|
||||
Append(asChoices[i]);
|
||||
}
|
||||
*/
|
||||
SetSize(pos.x, pos.y, size.x, size.y);
|
||||
SetSize( rPos.x
|
||||
,rPos.y
|
||||
,rSize.x
|
||||
,rSize.y
|
||||
);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
} // end of wxChoice::Create
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// adding/deleting items to/from the list
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxChoice::DoAppend(const wxString& item)
|
||||
int wxChoice::DoAppend(
|
||||
const wxString& rsItem
|
||||
)
|
||||
{
|
||||
// TODO:
|
||||
/*
|
||||
int n = (int)SendMessage(GetHwnd(), CB_ADDSTRING, 0, (LONG)item.c_str());
|
||||
if ( n == CB_ERR )
|
||||
{
|
||||
wxLogLastError("SendMessage(CB_ADDSTRING)");
|
||||
}
|
||||
*/
|
||||
return 0; //n
|
||||
}
|
||||
int nIndex;
|
||||
SHORT nIndexType = 0;
|
||||
|
||||
void wxChoice::Delete(int n)
|
||||
if (m_windowStyle & wxLB_SORT)
|
||||
nIndexType = LIT_SORTASCENDING;
|
||||
else
|
||||
nIndexType = LIT_END;
|
||||
nIndex = (int)::WinSendMsg( GetHwnd()
|
||||
,LM_INSERTITEM
|
||||
,(MPARAM)nIndexType
|
||||
,(MPARAM)rsItem.c_str()
|
||||
);
|
||||
return nIndex;
|
||||
} // end of wxChoice::DoAppend
|
||||
|
||||
void wxChoice::Delete(
|
||||
int n
|
||||
)
|
||||
{
|
||||
wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") );
|
||||
|
||||
// TODO: SendMessage(GetHwnd(), CB_DELETESTRING, n, 0);
|
||||
}
|
||||
::WinSendMsg(GetHwnd(), LM_DELETEITEM, (MPARAM)n, (MPARAM)0);
|
||||
} // end of wxChoice::Delete
|
||||
|
||||
void wxChoice::Clear()
|
||||
{
|
||||
// TODO: SendMessage(GetHwnd(), CB_RESETCONTENT, 0, 0);
|
||||
}
|
||||
Free();
|
||||
::WinSendMsg(GetHwnd(), LM_DELETEALL, (MPARAM)0, (MPARAM)0);
|
||||
} // end of wxChoice::Clear
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// selection
|
||||
@ -97,14 +128,19 @@ void wxChoice::Clear()
|
||||
|
||||
int wxChoice::GetSelection() const
|
||||
{
|
||||
// TODO: return (int)SendMessage(GetHwnd(), CB_GETCURSEL, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
return((int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)LIT_FIRST, (MPARAM)0)));
|
||||
} // end of wxChoice::GetSelection
|
||||
|
||||
void wxChoice::SetSelection(int n)
|
||||
void wxChoice::SetSelection(
|
||||
int n
|
||||
)
|
||||
{
|
||||
// TODO: SendMessage(GetHwnd(), CB_SETCURSEL, n, 0);
|
||||
}
|
||||
::WinSendMsg( GetHwnd()
|
||||
,LM_SELECTITEM
|
||||
,(MPARAM)n
|
||||
,(MPARAM)TRUE
|
||||
);
|
||||
} // end of wxChoice::SetSelection
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// string list functions
|
||||
@ -112,23 +148,38 @@ void wxChoice::SetSelection(int n)
|
||||
|
||||
int wxChoice::GetCount() const
|
||||
{
|
||||
// TODO: return (int)SendMessage(GetHwnd(), CB_GETCOUNT, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
return((int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMCOUNT, (MPARAM)0, (MPARAM)0)));
|
||||
} // end of wxChoice::GetCount
|
||||
|
||||
int wxChoice::FindString(const wxString& s) const
|
||||
int wxChoice::FindString(
|
||||
const wxString& rsStr
|
||||
) const
|
||||
{
|
||||
// TODO:
|
||||
/*
|
||||
int pos = (int)SendMessage(GetHwnd(), CB_FINDSTRINGEXACT,
|
||||
(WPARAM)-1, (LPARAM)s.c_str());
|
||||
int nPos;
|
||||
int nTextLength;
|
||||
PSZ zStr;
|
||||
int nItemCount;
|
||||
|
||||
return pos == LB_ERR ? wxNOT_FOUND : pos;
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
nItemCount = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMCOUNT, (MPARAM)0, (MPARAM)0));
|
||||
for (nPos = 0; nPos < nItemCount; nPos++)
|
||||
{
|
||||
nTextLength = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0));
|
||||
zStr = new char[nTextLength + 1];
|
||||
::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)nPos, (SHORT)nTextLength), (MPARAM)zStr);
|
||||
if (rsStr == (char*)zStr)
|
||||
{
|
||||
delete [] zStr;
|
||||
break;
|
||||
}
|
||||
delete [] zStr;
|
||||
}
|
||||
return nPos;
|
||||
} // end of wxChoice::FindString
|
||||
|
||||
void wxChoice::SetString(int n, const wxString& s)
|
||||
void wxChoice::SetString(
|
||||
int n
|
||||
, const wxString& rsStr
|
||||
)
|
||||
{
|
||||
wxFAIL_MSG(wxT("not implemented"));
|
||||
|
||||
@ -136,153 +187,199 @@ void wxChoice::SetString(int n, const wxString& s)
|
||||
Delete(n);
|
||||
Insert(n + 1, s);
|
||||
#endif
|
||||
}
|
||||
} // end of wxChoice::SetString
|
||||
|
||||
wxString wxChoice::GetString(int n) const
|
||||
wxString wxChoice::GetString(
|
||||
int n
|
||||
) const
|
||||
{
|
||||
size_t len = 0; // TODO: (size_t)::SendMessage(GetHwnd(), CB_GETLBTEXTLEN, n, 0);
|
||||
wxString str = "";
|
||||
// TODO:
|
||||
/*
|
||||
if (len) {
|
||||
if ( ::SendMessage(GetHwnd(), CB_GETLBTEXT, n,
|
||||
(LPARAM)str.GetWriteBuf(len)) == CB_ERR ) {
|
||||
wxLogLastError("SendMessage(CB_GETLBTEXT)");
|
||||
}
|
||||
str.UngetWriteBuf();
|
||||
size_t nLen = 0;
|
||||
wxString sStr = "";
|
||||
char* zBuf;
|
||||
|
||||
nLen = (size_t)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)n, (MPARAM)0));
|
||||
if (nLen)
|
||||
{
|
||||
zBuf = new char[nLen + 1];
|
||||
::WinSendMsg( GetHwnd()
|
||||
,LM_QUERYITEMTEXT
|
||||
,MPFROM2SHORT((SHORT)n, (SHORT)nLen)
|
||||
,(MPARAM)zBuf
|
||||
);
|
||||
sStr = zBuf;
|
||||
delete [] zBuf;
|
||||
}
|
||||
*/
|
||||
return str;
|
||||
}
|
||||
return sStr;
|
||||
} // end of wxChoice::GetString
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// client data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
void wxChoice::DoSetItemClientData(
|
||||
int n
|
||||
, void* pClientData
|
||||
)
|
||||
{
|
||||
// TODO:
|
||||
/*
|
||||
if ( SendMessage(GetHwnd(), CB_SETITEMDATA, n, (LPARAM)clientData) == CB_ERR )
|
||||
{
|
||||
wxLogLastError(wxT("CB_SETITEMDATA"));
|
||||
}
|
||||
*/
|
||||
}
|
||||
::WinSendMsg(GetHwnd(), LM_SETITEMHANDLE, (MPARAM)n, MPFROMP(pClientData));
|
||||
} // end of wxChoice::DoSetItemClientData
|
||||
|
||||
void* wxChoice::DoGetItemClientData( int n ) const
|
||||
{
|
||||
// TODO:
|
||||
/*
|
||||
LPARAM rc = SendMessage(GetHwnd(), CB_GETITEMDATA, n, 0);
|
||||
if ( rc == CB_ERR )
|
||||
{
|
||||
wxLogLastError(wxT("CB_GETITEMDATA"));
|
||||
MRESULT rc = 0L;
|
||||
|
||||
// unfortunately, there is no way to return an error code to the user
|
||||
rc = (LPARAM) NULL;
|
||||
}
|
||||
rc = ::WinSendMsg(GetHwnd(), LM_QUERYITEMHANDLE, (MPARAM)n, (MPARAM)0);
|
||||
return((void*)rc);
|
||||
} // end of wxChoice::DoSetItemClientData
|
||||
|
||||
return (void *)rc;
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
void wxChoice::DoSetItemClientObject(
|
||||
int n
|
||||
, wxClientData* pClientData
|
||||
)
|
||||
{
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
DoSetItemClientData( n
|
||||
,pClientData
|
||||
);
|
||||
} // end of wxChoice::DoSetItemClientObject
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
wxClientData* wxChoice::DoGetItemClientObject(
|
||||
int n
|
||||
) const
|
||||
{
|
||||
return (wxClientData *)DoGetItemClientData(n);
|
||||
}
|
||||
} // end of wxChoice::DoGetItemClientObject
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxOS2 specific helpers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxChoice::DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags)
|
||||
void wxChoice::DoSetSize(
|
||||
int nX
|
||||
, int nY
|
||||
, int nWidth
|
||||
, int nHeight
|
||||
, int nSizeFlags
|
||||
)
|
||||
{
|
||||
//
|
||||
// Ignore height parameter because height doesn't mean 'initially
|
||||
// displayed' height, it refers to the drop-down menu as well. The
|
||||
// wxWindows interpretation is different; also, getting the size returns
|
||||
// the _displayed_ size (NOT the drop down menu size) so
|
||||
// setting-getting-setting size would not work.
|
||||
wxControl::DoSetSize(x, y, width, -1, sizeFlags);
|
||||
}
|
||||
//
|
||||
wxControl::DoSetSize( nX
|
||||
,nY
|
||||
,nWidth
|
||||
,-1
|
||||
,nSizeFlags
|
||||
);
|
||||
} // end of wxChoice::DoSetSize
|
||||
|
||||
wxSize wxChoice::DoGetBestSize() const
|
||||
{
|
||||
// find the widest string
|
||||
int wLine;
|
||||
int wChoice = 0;
|
||||
int nItems = GetCount();
|
||||
for ( int i = 0; i < nItems; i++ )
|
||||
//
|
||||
// Find the widest string
|
||||
//
|
||||
int nLineWidth;
|
||||
int nChoiceWidth = 0;
|
||||
int nItems = GetCount();
|
||||
int nCx;
|
||||
int nCy;
|
||||
|
||||
for (int i = 0; i < nItems; i++)
|
||||
{
|
||||
wxString str(GetString(i));
|
||||
GetTextExtent(str, &wLine, NULL);
|
||||
if ( wLine > wChoice )
|
||||
wChoice = wLine;
|
||||
wxString sStr(GetString(i));
|
||||
|
||||
GetTextExtent( sStr
|
||||
,&nLineWidth
|
||||
,NULL
|
||||
);
|
||||
if (nLineWidth > nChoiceWidth)
|
||||
nChoiceWidth = nLineWidth;
|
||||
}
|
||||
|
||||
// give it some reasonable default value if there are no strings in the
|
||||
//
|
||||
// Give it some reasonable default value if there are no strings in the
|
||||
// list
|
||||
if ( wChoice == 0 )
|
||||
wChoice = 100;
|
||||
//
|
||||
if (nChoiceWidth == 0L)
|
||||
nChoiceWidth = 100L;
|
||||
|
||||
// the combobox should be larger than the widest string
|
||||
int cx, cy;
|
||||
wxGetCharSize(GetHWND(), &cx, &cy, (wxFont*)&GetFont());
|
||||
|
||||
wChoice += 5*cx;
|
||||
//
|
||||
// The combobox should be larger than the widest string
|
||||
//
|
||||
wxGetCharSize( GetHWND()
|
||||
,&nCx
|
||||
,&nCy
|
||||
,(wxFont*)&GetFont()
|
||||
);
|
||||
nChoiceWidth += 5 * nCx;
|
||||
|
||||
//
|
||||
// Choice drop-down list depends on number of items (limited to 10)
|
||||
size_t nStrings = nItems == 0 ? 10 : wxMin(10, nItems) + 1;
|
||||
int hChoice = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)*nStrings;
|
||||
//
|
||||
size_t nStrings = nItems == 0 ? 10 : wxMin(10, nItems) + 1;
|
||||
int nChoiceHeight = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nCy) * nStrings;
|
||||
|
||||
return wxSize(wChoice, hChoice);
|
||||
}
|
||||
return wxSize( nChoiceWidth
|
||||
,nChoiceHeight
|
||||
);
|
||||
} // end of wxChoice::DoGetBestSize
|
||||
|
||||
MRESULT wxChoice::OS2WindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
MRESULT wxChoice::OS2WindowProc(
|
||||
WXUINT uMsg
|
||||
, WXWPARAM wParam
|
||||
, WXLPARAM lParam
|
||||
)
|
||||
{
|
||||
// TODO:
|
||||
/*
|
||||
if ( nMsg == WM_LBUTTONUP )
|
||||
{
|
||||
int x = (int)LOWORD(lParam);
|
||||
int y = (int)HIWORD(lParam);
|
||||
return wxWindow::OS2WindowProc( uMsg
|
||||
,wParam
|
||||
,lParam
|
||||
);
|
||||
} // end of wxChoice::OS2WindowProc
|
||||
|
||||
// Ok, this is truly weird, but if a panel with a wxChoice loses the
|
||||
// focus, then you get a *fake* WM_LBUTTONUP message with x = 65535 and
|
||||
// y = 65535. Filter out this nonsense.
|
||||
bool wxChoice::OS2Command(
|
||||
WXUINT uParam
|
||||
, WXWORD WXUNUSED(wId)
|
||||
)
|
||||
{
|
||||
if (uParam != LN_SELECT)
|
||||
{
|
||||
//
|
||||
// VZ: I'd like to know how to reproduce this please...
|
||||
if ( x == 65535 && y == 65535 )
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
return wxWindow::OS2WindowProc(nMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
bool wxChoice::OS2Command(WXUINT param, WXWORD WXUNUSED(id))
|
||||
{
|
||||
// TODO:
|
||||
/*
|
||||
if ( param != CBN_SELCHANGE)
|
||||
{
|
||||
// "selection changed" is the only event we're after
|
||||
//
|
||||
return FALSE;
|
||||
}
|
||||
*/
|
||||
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
|
||||
event.SetInt(GetSelection());
|
||||
event.SetEventObject(this);
|
||||
// TODO: event.SetString(GetStringSelection());
|
||||
ProcessCommand(event);
|
||||
int n = GetSelection();
|
||||
|
||||
if (n > -1)
|
||||
{
|
||||
wxCommandEvent vEvent( wxEVT_COMMAND_CHOICE_SELECTED
|
||||
,m_windowId
|
||||
);
|
||||
|
||||
vEvent.SetInt(n);
|
||||
vEvent.SetEventObject(this);
|
||||
vEvent.SetString((char*)GetStringSelection().c_str());
|
||||
if (HasClientObjectData())
|
||||
vEvent.SetClientObject(GetClientObject(n));
|
||||
else if (HasClientUntypedData())
|
||||
vEvent.SetClientData(GetClientData(n));
|
||||
ProcessCommand(vEvent);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
} // end of wxChoice::OS2Command
|
||||
|
||||
void wxChoice::Free()
|
||||
{
|
||||
if (HasClientObjectData())
|
||||
{
|
||||
size_t nCount = GetCount();
|
||||
|
||||
for (size_t n = 0; n < nCount; n++)
|
||||
{
|
||||
delete GetClientObject(n);
|
||||
}
|
||||
}
|
||||
} // end of wxhoice::Free
|
||||
|
@ -24,279 +24,435 @@
|
||||
#include "wx/clipbrd.h"
|
||||
#include "wx/os2/private.h"
|
||||
|
||||
#define OWNER_DRAWN_LISTBOX_EXTRA_SPACE (1)
|
||||
|
||||
MRESULT EXPENTRY wxComboEditWndProc( HWND hWnd
|
||||
,UINT uMessage
|
||||
,MPARAM wParam
|
||||
,MPARAM lParam
|
||||
);
|
||||
//
|
||||
// The pointer to standard wnd proc
|
||||
//
|
||||
static WXFARPROC gfnWndprocEdit = (WXFARPROC)NULL;
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
|
||||
|
||||
bool wxComboBox::OS2Command(WXUINT param, WXWORD WXUNUSED(id))
|
||||
bool wxComboBox::OS2Command(
|
||||
WXUINT uParam
|
||||
, WXWORD WXUNUSED(wId)
|
||||
)
|
||||
{
|
||||
// TODO:
|
||||
/*
|
||||
if (param == CBN_SELCHANGE)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId);
|
||||
event.SetInt(GetSelection());
|
||||
event.SetEventObject(this);
|
||||
event.SetString(GetStringSelection());
|
||||
ProcessCommand(event);
|
||||
long lSel = -1L;
|
||||
wxString sValue;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else if (param == CBN_EDITCHANGE)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
|
||||
event.SetString(GetValue());
|
||||
event.SetEventObject(this);
|
||||
ProcessCommand(event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n, const wxString choices[],
|
||||
long style,
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator,
|
||||
#endif
|
||||
const wxString& name)
|
||||
{
|
||||
SetName(name);
|
||||
#if wxUSE_VALIDATORS
|
||||
SetValidator(validator);
|
||||
#endif
|
||||
if (parent) parent->AddChild(this);
|
||||
SetBackgroundColour(parent->GetBackgroundColour()) ;
|
||||
SetForegroundColour(parent->GetForegroundColour()) ;
|
||||
|
||||
m_windowStyle = style;
|
||||
|
||||
if ( id == -1 )
|
||||
m_windowId = (int)NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
|
||||
int x = pos.x;
|
||||
int y = pos.y;
|
||||
int width = size.x;
|
||||
int height = size.y;
|
||||
// TODO:
|
||||
/*
|
||||
long msStyle = WS_CHILD | WS_TABSTOP | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |
|
||||
CBS_NOINTEGRALHEIGHT;
|
||||
|
||||
if (m_windowStyle & wxCB_READONLY)
|
||||
msStyle |= CBS_DROPDOWNLIST;
|
||||
else if (m_windowStyle & wxCB_SIMPLE)
|
||||
msStyle |= CBS_SIMPLE; // A list (shown always) and edit control
|
||||
else
|
||||
msStyle |= CBS_DROPDOWN;
|
||||
|
||||
if (m_windowStyle & wxCB_SORT)
|
||||
msStyle |= CBS_SORT;
|
||||
|
||||
bool want3D;
|
||||
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
|
||||
|
||||
// Even with extended styles, need to combine with WS_BORDER
|
||||
// for them to look right.
|
||||
if ( want3D || wxStyleHasBorder(m_windowStyle) )
|
||||
msStyle |= WS_BORDER;
|
||||
|
||||
m_hWnd = (WXHWND)::CreateWindowEx(exStyle, wxT("COMBOBOX"), NULL,
|
||||
msStyle,
|
||||
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
|
||||
wxGetInstance(), NULL);
|
||||
|
||||
wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create combobox") );
|
||||
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin(m_hWnd);
|
||||
|
||||
SetFont(parent->GetFont());
|
||||
int i;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
Append(choices[i]);
|
||||
}
|
||||
|
||||
SetSelection(i);
|
||||
|
||||
SetSize(x, y, width, height);
|
||||
if ( !value.IsEmpty() )
|
||||
{
|
||||
SetValue(value);
|
||||
}
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxComboBox::SetValue(const wxString& value)
|
||||
{
|
||||
// If newlines are denoted by just 10, must stick 13 in front.
|
||||
int singletons = 0;
|
||||
int len = value.Length();
|
||||
int i;
|
||||
for (i = 0; i < len; i ++)
|
||||
{
|
||||
if ((i > 0) && (value[i] == 10) && (value[i-1] != 13))
|
||||
singletons ++;
|
||||
}
|
||||
if (singletons > 0)
|
||||
{
|
||||
wxChar *tmp = new wxChar[len + singletons + 1];
|
||||
int j = 0;
|
||||
for (i = 0; i < len; i ++)
|
||||
switch (uParam)
|
||||
{
|
||||
if ((i > 0) && (value[i] == 10) && (value[i-1] != 13))
|
||||
{
|
||||
tmp[j] = 13;
|
||||
j ++;
|
||||
}
|
||||
tmp[j] = value[i];
|
||||
j ++;
|
||||
}
|
||||
tmp[j] = 0;
|
||||
// SetWindowText(GetHwnd(), tmp);
|
||||
delete[] tmp;
|
||||
}
|
||||
// else
|
||||
// SetWindowText(GetHwnd(), value);
|
||||
}
|
||||
case LN_SELECT:
|
||||
if (GetSelection() > -1)
|
||||
{
|
||||
wxCommandEvent vEvent( wxEVT_COMMAND_COMBOBOX_SELECTED
|
||||
,GetId()
|
||||
);
|
||||
|
||||
vEvent.SetInt(GetSelection());
|
||||
vEvent.SetEventObject(this);
|
||||
vEvent.SetString((char*)GetStringSelection().c_str());
|
||||
ProcessCommand(vEvent);
|
||||
}
|
||||
break;
|
||||
|
||||
case EN_CHANGE:
|
||||
{
|
||||
wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED
|
||||
,GetId()
|
||||
);
|
||||
|
||||
if (lSel == -1L)
|
||||
sValue = GetValue();
|
||||
else
|
||||
SetValue(sValue);
|
||||
vEvent.SetString((char*)GetValue().c_str());
|
||||
vEvent.SetEventObject(this);
|
||||
ProcessCommand(vEvent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
//
|
||||
// There is no return value for the CBN_ notifications, so always return
|
||||
// FALSE from here to pass the message to DefWindowProc()
|
||||
//
|
||||
return FALSE;
|
||||
} // end of wxComboBox::OS2Command
|
||||
|
||||
bool wxComboBox::Create(
|
||||
wxWindow* pParent
|
||||
, wxWindowID vId
|
||||
, const wxString& rsValue
|
||||
, const wxPoint& rPos
|
||||
, const wxSize& rSize
|
||||
, int n
|
||||
, const wxString asChoices[]
|
||||
, long lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
, const wxValidator& rValidator
|
||||
#endif
|
||||
, const wxString& rsName
|
||||
)
|
||||
{
|
||||
|
||||
if (!OS2CreateControl( pParent
|
||||
,vId
|
||||
,rPos
|
||||
,rSize
|
||||
,lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
,rValidator
|
||||
#endif
|
||||
,rsName
|
||||
))
|
||||
return FALSE;
|
||||
|
||||
//
|
||||
// Get the right style
|
||||
//
|
||||
long lSstyle = 0L;
|
||||
|
||||
lSstyle = WS_TABSTOP |
|
||||
WS_VISIBLE;
|
||||
|
||||
if (lStyle & wxCLIP_SIBLINGS )
|
||||
lSstyle |= WS_CLIPSIBLINGS;
|
||||
if (lStyle & wxCB_READONLY)
|
||||
lSstyle |= CBS_DROPDOWNLIST;
|
||||
else if (lStyle & wxCB_SIMPLE)
|
||||
lSstyle |= CBS_SIMPLE; // A list (shown always) and edit control
|
||||
else
|
||||
lSstyle |= CBS_DROPDOWN;
|
||||
|
||||
|
||||
if (!OS2CreateControl( "COMBOBOX"
|
||||
,lSstyle
|
||||
))
|
||||
return FALSE;
|
||||
|
||||
//
|
||||
// A choice/combobox normally has a white background (or other, depending
|
||||
// on global settings) rather than inheriting the parent's background colour.
|
||||
//
|
||||
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
|
||||
|
||||
SetFont(pParent->GetFont());
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
Append(asChoices[i]);
|
||||
}
|
||||
|
||||
SetSize( rPos.x
|
||||
,rPos.y
|
||||
,rSize.x
|
||||
,rSize.y
|
||||
);
|
||||
if (!rsValue.IsEmpty())
|
||||
{
|
||||
SetValue(rsValue);
|
||||
}
|
||||
gfnWndprocEdit = (WXFARPROC)::WinSubclassWindow( (HWND)GetHwnd()
|
||||
,(PFNWP)wxComboEditWndProc
|
||||
);
|
||||
return TRUE;
|
||||
} // end of wxComboBox::Create
|
||||
|
||||
void wxComboBox::SetValue(
|
||||
const wxString& rsValue
|
||||
)
|
||||
{
|
||||
//
|
||||
// If newlines are denoted by just 10, must stick 13 in front.
|
||||
//
|
||||
int nSingletons = 0;
|
||||
int nLen = rsValue.Length();
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nLen; i ++)
|
||||
{
|
||||
if ((i > 0) && (rsValue[i] == 10) && (rsValue[i - 1] != 13))
|
||||
nSingletons ++;
|
||||
}
|
||||
if (nSingletons > 0)
|
||||
{
|
||||
wxChar* zTmp = new wxChar[nLen + nSingletons + 1];
|
||||
int j = 0;
|
||||
|
||||
for (i = 0; i < nLen; i ++)
|
||||
{
|
||||
if ((i > 0) && (rsValue[i] == 10) && (rsValue[i - 1] != 13))
|
||||
{
|
||||
zTmp[j] = 13;
|
||||
j++;
|
||||
}
|
||||
zTmp[j] = rsValue[i];
|
||||
j++;
|
||||
}
|
||||
zTmp[j] = 0;
|
||||
::WinSetWindowText(GetHwnd(), zTmp);
|
||||
delete[] zTmp;
|
||||
}
|
||||
else
|
||||
::WinSetWindowText(GetHwnd(), rsValue.c_str());
|
||||
} // end of wxComboBox::SetValue
|
||||
|
||||
//
|
||||
// Clipboard operations
|
||||
//
|
||||
void wxComboBox::Copy()
|
||||
{
|
||||
HWND hWnd = GetHwnd();
|
||||
// SendMessage(hWnd, WM_COPY, 0, 0L);
|
||||
}
|
||||
HWND hWnd = GetHwnd();
|
||||
|
||||
::WinSendMsg(hWnd, EM_COPY, (MPARAM)0, (MPARAM)0);
|
||||
} // end of wxComboBox::Copy
|
||||
|
||||
void wxComboBox::Cut()
|
||||
{
|
||||
HWND hWnd = GetHwnd();
|
||||
// SendMessage(hWnd, WM_CUT, 0, 0L);
|
||||
}
|
||||
HWND hWnd = GetHwnd();
|
||||
|
||||
::WinSendMsg(hWnd, EM_CUT, (MPARAM)0, (MPARAM)0);
|
||||
} // end of wxComboBox::Cut
|
||||
|
||||
void wxComboBox::Paste()
|
||||
{
|
||||
HWND hWnd = GetHwnd();
|
||||
// SendMessage(hWnd, WM_PASTE, 0, 0L);
|
||||
}
|
||||
HWND hWnd = GetHwnd();
|
||||
|
||||
void wxComboBox::SetEditable(bool editable)
|
||||
{
|
||||
// Can't implement in MSW?
|
||||
// HWND hWnd = GetHwnd();
|
||||
// SendMessage(hWnd, EM_SETREADONLY, (WPARAM)!editable, (LPARAM)0L);
|
||||
}
|
||||
::WinSendMsg(hWnd, EM_PASTE, (MPARAM)0, (MPARAM)0);
|
||||
} // end of wxComboBox::Paste
|
||||
|
||||
void wxComboBox::SetInsertionPoint(long pos)
|
||||
void wxComboBox::SetEditable(
|
||||
bool bEditable
|
||||
)
|
||||
{
|
||||
/*
|
||||
HWND hWnd = GetHwnd();
|
||||
SendMessage(hWnd, EM_SETSEL, pos, pos);
|
||||
SendMessage(hWnd, EM_SCROLLCARET, (WPARAM)0, (LPARAM)0);
|
||||
char *nothing = "";
|
||||
SendMessage(hWnd, EM_REPLACESEL, 0, (LPARAM)nothing);
|
||||
*/
|
||||
}
|
||||
HWND hWnd = GetHwnd();
|
||||
|
||||
::WinSendMsg(hWnd, EM_SETREADONLY, (MPARAM)!bEditable, (MPARAM)0L);
|
||||
} // end of wxComboBox::SetEditable
|
||||
|
||||
void wxComboBox::SetInsertionPoint(
|
||||
long lPos
|
||||
)
|
||||
{
|
||||
HWND hWnd = GetHwnd();
|
||||
|
||||
::WinSendMsg(hWnd, EM_SETFIRSTCHAR, MPFROMLONG(lPos), (MPARAM)0);
|
||||
} // end of wxComboBox::SetInsertionPoint
|
||||
|
||||
void wxComboBox::SetInsertionPointEnd()
|
||||
{
|
||||
/*
|
||||
long pos = GetLastPosition();
|
||||
SetInsertionPoint(pos);
|
||||
*/
|
||||
}
|
||||
long lPos = GetLastPosition();
|
||||
|
||||
SetInsertionPoint(lPos);
|
||||
} // end of wxComboBox::SetInsertionPointEnd
|
||||
|
||||
long wxComboBox::GetInsertionPoint() const
|
||||
{
|
||||
/*
|
||||
DWORD Pos=(DWORD)SendMessage(GetHwnd(), EM_GETSEL, 0, 0L);
|
||||
return Pos&0xFFFF;
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
long lPos = LONGFROMMR(::WinSendMsg( GetHwnd()
|
||||
,LM_QUERYSELECTION
|
||||
,(MPARAM)0
|
||||
,(MPARAM)0
|
||||
));
|
||||
if (lPos == LIT_NONE)
|
||||
return wxNOT_FOUND;
|
||||
return lPos;
|
||||
} // end of wxComboBox::GetInsertionPoint
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
{
|
||||
/*
|
||||
HWND hWnd = GetHwnd();
|
||||
HWND hEditWnd = GetHwnd();
|
||||
long lLineLength = 0L;
|
||||
WNDPARAMS vParams;
|
||||
|
||||
// Will always return a number > 0 (according to docs)
|
||||
int noLines = (int)SendMessage(hWnd, EM_GETLINECOUNT, (WPARAM)0, (LPARAM)0L);
|
||||
|
||||
// This gets the char index for the _beginning_ of the last line
|
||||
int charIndex = (int)SendMessage(hWnd, EM_LINEINDEX, (WPARAM)(noLines-1), (LPARAM)0L);
|
||||
|
||||
// Get number of characters in the last line. We'll add this to the character
|
||||
//
|
||||
// Get number of characters in the last (only) line. We'll add this to the character
|
||||
// index for the last line, 1st position.
|
||||
int lineLength = (int)SendMessage(hWnd, EM_LINELENGTH, (WPARAM)charIndex, (LPARAM)0L);
|
||||
//
|
||||
|
||||
return (long)(charIndex + lineLength);
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxComboBox::Replace(long from, long to, const wxString& value)
|
||||
vParams.fsStatus = WPM_CCHTEXT;
|
||||
if (::WinSendMsg( GetHwnd()
|
||||
,WM_QUERYWINDOWPARAMS
|
||||
,&vParams
|
||||
,0
|
||||
))
|
||||
{
|
||||
lLineLength = (long)vParams.cchText;
|
||||
}
|
||||
else
|
||||
lLineLength = 0L;
|
||||
return lLineLength;
|
||||
} // end of wxComboBox::GetLastPosition
|
||||
|
||||
void wxComboBox::Replace(
|
||||
long lFrom
|
||||
, long lTo
|
||||
, const wxString& rsValue
|
||||
)
|
||||
{
|
||||
#if wxUSE_CLIPBOARD
|
||||
HWND hWnd = GetHwnd();
|
||||
long fromChar = from;
|
||||
long toChar = to;
|
||||
HWND hWnd = GetHwnd();
|
||||
long lFromChar = lFrom;
|
||||
long lToChar = lTo;
|
||||
|
||||
//
|
||||
// Set selection and remove it
|
||||
// SendMessage(hWnd, CB_SETEDITSEL, fromChar, toChar);
|
||||
// SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0);
|
||||
//
|
||||
::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFrom, (USHORT)lTo), 0);
|
||||
::WinSendMsg(hWnd, EM_CUT, (MPARAM)0, (MPARAM)0);
|
||||
|
||||
//
|
||||
// Now replace with 'value', by pasting.
|
||||
wxSetClipboardData(wxDF_TEXT, (wxObject *)(const wxChar *)value, 0, 0);
|
||||
//
|
||||
wxSetClipboardData( wxDF_TEXT
|
||||
,(wxObject *)rsValue.c_str()
|
||||
,0
|
||||
,0
|
||||
);
|
||||
|
||||
//
|
||||
// Paste into edit control
|
||||
// SendMessage(hWnd, WM_PASTE, (WPARAM)0, (LPARAM)0L);
|
||||
//
|
||||
::WinSendMsg(hWnd, EM_PASTE, (MPARAM)0, (MPARAM)0L);
|
||||
#endif
|
||||
}
|
||||
} // end of wxComboBox::Replace
|
||||
|
||||
void wxComboBox::Remove(long from, long to)
|
||||
void wxComboBox::Remove(
|
||||
long lFrom
|
||||
, long lTo
|
||||
)
|
||||
{
|
||||
HWND hWnd = GetHwnd();
|
||||
long fromChar = from;
|
||||
long toChar = to;
|
||||
#if wxUSE_CLIPBOARD
|
||||
HWND hWnd = GetHwnd();
|
||||
long lFromChar = lFrom;
|
||||
long lToChar = lTo;
|
||||
|
||||
// Cut all selected text
|
||||
// SendMessage(hWnd, CB_SETEDITSEL, fromChar, toChar);
|
||||
// SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0);
|
||||
}
|
||||
::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFrom, (USHORT)lTo), 0);
|
||||
::WinSendMsg(hWnd, EM_CUT, (MPARAM)0, (MPARAM)0);
|
||||
#endif
|
||||
} // end of wxComboBox::Remove
|
||||
|
||||
void wxComboBox::SetSelection(long from, long to)
|
||||
void wxComboBox::SetSelection(
|
||||
long lFrom
|
||||
, long lTo
|
||||
)
|
||||
{
|
||||
HWND hWnd = GetHwnd();
|
||||
long fromChar = from;
|
||||
long toChar = to;
|
||||
// if from and to are both -1, it means
|
||||
HWND hWnd = GetHwnd();
|
||||
long lFromChar = lFrom;
|
||||
long lToChar = lTo;
|
||||
|
||||
//
|
||||
// If from and to are both -1, it means
|
||||
// (in wxWindows) that all text should be selected.
|
||||
// This translates into Windows convention
|
||||
if ((from == -1) && (to == -1))
|
||||
//
|
||||
if ((lFrom == -1L) && (lTo == -1L))
|
||||
{
|
||||
fromChar = 0;
|
||||
toChar = -1;
|
||||
lFromChar = 0;
|
||||
lToChar = -1;
|
||||
}
|
||||
|
||||
// SendMessage(hWnd, CB_SETEDITSEL, (WPARAM)fromChar, (LPARAM)toChar);
|
||||
// SendMessage(hWnd, EM_SCROLLCARET, (WPARAM)0, (LPARAM)0);
|
||||
}
|
||||
::WinSendMsg( hWnd
|
||||
,EM_SETSEL
|
||||
,MPFROM2SHORT((USHORT)lFromChar, (USHORT)lToChar)
|
||||
,(MPARAM)0
|
||||
);
|
||||
} // end of wxComboBox::SetSelection
|
||||
|
||||
void wxComboBox::DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags)
|
||||
void wxComboBox::DoSetSize(
|
||||
int nX
|
||||
, int nY
|
||||
, int nWidth
|
||||
, int nHeight
|
||||
, int nSizeFlags
|
||||
)
|
||||
{
|
||||
wxControl::DoSetSize(x, y, width, height, sizeFlags);
|
||||
}
|
||||
wxControl::DoSetSize( nX
|
||||
,nY
|
||||
,nWidth
|
||||
,nHeight
|
||||
,nSizeFlags
|
||||
);
|
||||
} // end of wxComboBox::DoSetSize
|
||||
|
||||
bool wxComboBox::ProcessEditMsg(
|
||||
WXUINT uMsg
|
||||
, WXWPARAM wParam
|
||||
, WXLPARAM lParam)
|
||||
{
|
||||
SHORT vFlag;
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_CHAR:
|
||||
vFlag = SHORT1FROMMP(wParam);
|
||||
switch(vFlag)
|
||||
{
|
||||
case KC_CHAR:
|
||||
return (HandleChar( SHORT1FROMMP(wParam)
|
||||
,lParam
|
||||
,TRUE /* isASCII */
|
||||
));
|
||||
|
||||
case KC_PREVDOWN:
|
||||
return (HandleKeyDown( SHORT1FROMMP(wParam)
|
||||
,lParam
|
||||
));
|
||||
|
||||
case KC_KEYUP:
|
||||
return (HandleKeyUp( SHORT1FROMMP(wParam)
|
||||
,lParam
|
||||
));
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
} // end of WinGuiBase_CComboBox::ProcessEditMsg
|
||||
|
||||
MRESULT EXPENTRY wxComboEditWndProc(
|
||||
HWND hWnd
|
||||
, UINT uMessage
|
||||
, MPARAM wParam
|
||||
, MPARAM lParam
|
||||
)
|
||||
{
|
||||
HWND hWndCombo;
|
||||
wxWindow* pWin = NULL;
|
||||
|
||||
hWndCombo = ::WinQueryWindow(hWnd, QW_PARENT);
|
||||
pWin = (wxWindow*)wxFindWinFromHandle((WXHWND)hWndCombo);
|
||||
switch (uMessage)
|
||||
{
|
||||
//
|
||||
// Forward some messages to the combobox
|
||||
//
|
||||
case WM_CHAR:
|
||||
{
|
||||
wxComboBox* pCombo = wxDynamicCast( pWin
|
||||
,wxComboBox
|
||||
);
|
||||
|
||||
if (pCombo->ProcessEditMsg( uMessage
|
||||
,wParam
|
||||
,lParam
|
||||
))
|
||||
return ((MRESULT)0);
|
||||
}
|
||||
break;
|
||||
|
||||
//
|
||||
// TODO: Deal with tooltips here
|
||||
//
|
||||
}
|
||||
return (gfnWndprocEdit(hWnd, (ULONG)uMessage, (MPARAM)wParam, (MPARAM)lParam));
|
||||
} // end of wxComboEditWndProc
|
||||
|
||||
#endif
|
||||
// wxUSE_COMBOBOX
|
||||
|
@ -74,6 +74,38 @@ wxControl::~wxControl()
|
||||
m_isBeingDeleted = TRUE;
|
||||
}
|
||||
|
||||
bool wxControl::OS2CreateControl(
|
||||
wxWindow* pParent
|
||||
, wxWindowID vId
|
||||
, const wxPoint& rPos
|
||||
, const wxSize& rSize
|
||||
, long lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
, const wxValidator& rValidator
|
||||
#endif
|
||||
, const wxString& rsName
|
||||
)
|
||||
{
|
||||
//
|
||||
// Even if it's possible to create controls without parents in some port,
|
||||
// it should surely be discouraged because it doesn't work at all under
|
||||
// Windows
|
||||
//
|
||||
if (!CreateBase( pParent
|
||||
,vId
|
||||
,rPos
|
||||
,rSize
|
||||
,lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
,rValidator
|
||||
#endif
|
||||
,rsName
|
||||
))
|
||||
return FALSE;
|
||||
pParent->AddChild(this);
|
||||
return TRUE;
|
||||
} // end of wxControl::OS2CreateControl
|
||||
|
||||
bool wxControl::OS2CreateControl(
|
||||
const wxChar* zClassname
|
||||
, WXDWORD dwStyle
|
||||
@ -99,6 +131,11 @@ bool wxControl::OS2CreateControl(
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PSZ zClass;
|
||||
|
||||
if ((strcmp(zClassname, "COMBOBOX")) == 0)
|
||||
zClass = WC_COMBOBOX;
|
||||
dwStyle |= WS_VISIBLE;
|
||||
m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(GetParent()) // Parent window handle
|
||||
,(PSZ)zClassname // Window class
|
||||
|
@ -108,6 +108,7 @@ void wxFrame::Init()
|
||||
m_nFsStatusBarHeight = 0;
|
||||
m_nFsToolBarHeight = 0;
|
||||
m_bFsIsMaximized = FALSE;
|
||||
m_bWasMinimized = FALSE;
|
||||
m_bFsIsShowing = FALSE;
|
||||
m_bIsShown = FALSE;
|
||||
m_pWinLastFocused = (wxWindow *)NULL;
|
||||
@ -1328,10 +1329,30 @@ void wxFrame::IconizeChildFrames(
|
||||
pNode = pNode->GetNext() )
|
||||
{
|
||||
wxWindow* pWin = pNode->GetData();
|
||||
wxFrame* pFrame = wxDynamicCast(pWin, wxFrame);
|
||||
|
||||
if (pWin->IsKindOf(CLASSINFO(wxFrame)) )
|
||||
if ( pFrame
|
||||
#if wxUSE_MDI_ARCHITECTURE
|
||||
&& !wxDynamicCast(pFrame, wxMDIChildFrame)
|
||||
#endif // wxUSE_MDI_ARCHITECTURE
|
||||
)
|
||||
{
|
||||
((wxFrame *)pWin)->Iconize(bIconize);
|
||||
//
|
||||
// We don't want to restore the child frames which had been
|
||||
// iconized even before we were iconized, so save the child frame
|
||||
// status when iconizing the parent frame and check it when
|
||||
// restoring it.
|
||||
//
|
||||
if (bIconize)
|
||||
{
|
||||
pFrame->m_bWasMinimized = pFrame->IsIconized();
|
||||
}
|
||||
|
||||
//
|
||||
// This test works for both iconizing and restoring
|
||||
//
|
||||
if (!pFrame->m_bWasMinimized)
|
||||
pFrame->Iconize(bIconize);
|
||||
}
|
||||
}
|
||||
} // end of wxFrame::IconizeChildFrames
|
||||
|
@ -297,6 +297,7 @@ COMMONOBJS = \
|
||||
..\common\$D\string.obj \
|
||||
..\common\$D\sysopt.obj \
|
||||
..\common\$D\tbarbase.obj \
|
||||
..\common\$D\textbuf.obj \
|
||||
..\common\$D\textcmn.obj \
|
||||
..\common\$D\textfile.obj \
|
||||
..\common\$D\timercmn.obj \
|
||||
@ -425,6 +426,7 @@ COMLIBOBJS3 = \
|
||||
string.obj \
|
||||
sysopt.obj \
|
||||
tbarbase.obj \
|
||||
textbuf.obj \
|
||||
textcmn.obj \
|
||||
textfile.obj \
|
||||
timercmn.obj \
|
||||
@ -788,6 +790,7 @@ $(COMLIBOBJS3):
|
||||
copy ..\common\$D\string.obj
|
||||
copy ..\common\$D\sysopt.obj
|
||||
copy ..\common\$D\tbarbase.obj
|
||||
copy ..\common\$D\textbuf.obj
|
||||
copy ..\common\$D\textcmn.obj
|
||||
copy ..\common\$D\textfile.obj
|
||||
copy ..\common\$D\timercmn.obj
|
||||
|
111
src/os2/wx23.def
111
src/os2/wx23.def
@ -4,7 +4,7 @@ DATA MULTIPLE NONSHARED READWRITE LOADONCALL
|
||||
CODE LOADONCALL
|
||||
|
||||
EXPORTS
|
||||
;From library: F:\DEV\WX2\WXWINDOWS\LIB\WX.lib
|
||||
;From library: H:\Dev\Wx2\WxWindows\lib\wx.lib
|
||||
;From object file: dummy.cpp
|
||||
;PUBDEFs (Symbols available from object file):
|
||||
wxDummyChar
|
||||
@ -1758,7 +1758,7 @@ EXPORTS
|
||||
wxEVT_NC_LEFT_DCLICK
|
||||
wxEVT_INIT_DIALOG
|
||||
wxEVT_COMMAND_SET_FOCUS
|
||||
;From object file: F:\DEV\WX2\WXWINDOWS\src\common\extended.c
|
||||
;From object file: H:\DEV\WX2\WXWINDOWS\src\common\extended.c
|
||||
;PUBDEFs (Symbols available from object file):
|
||||
ConvertToIeeeExtended
|
||||
ConvertFromIeeeExtended
|
||||
@ -1872,6 +1872,8 @@ EXPORTS
|
||||
FindEntry__17wxFileConfigGroupCFPCc
|
||||
;wxFileConfigEntry::SetValue(const wxString&,unsigned long)
|
||||
SetValue__17wxFileConfigEntryFRC8wxStringUl
|
||||
;wxFileConfig::wxFileConfig(wxInputStream&)
|
||||
__ct__12wxFileConfigFR13wxInputStream
|
||||
;wxFileConfig::RenameGroup(const wxString&,const wxString&)
|
||||
RenameGroup__12wxFileConfigFRC8wxStringT1
|
||||
;wxFileConfig::Init()
|
||||
@ -1882,12 +1884,10 @@ EXPORTS
|
||||
LineListAppend__12wxFileConfigFRC8wxString
|
||||
;wxFileConfig::DeleteGroup(const wxString&)
|
||||
DeleteGroup__12wxFileConfigFRC8wxString
|
||||
;wxFileConfig::Parse(wxTextFile&,unsigned long)
|
||||
Parse__12wxFileConfigFR10wxTextFileUl
|
||||
;wxFileConfig::LineListInsert(const wxString&,wxFileConfigLineList*)
|
||||
LineListInsert__12wxFileConfigFRC8wxStringP20wxFileConfigLineList
|
||||
;wxFileConfig::Flush(unsigned long)
|
||||
Flush__12wxFileConfigFUl
|
||||
;wxFileConfig::LineListInsert(const wxString&,wxFileConfigLineList*)
|
||||
LineListInsert__12wxFileConfigFRC8wxStringP20wxFileConfigLineList
|
||||
;wxFileConfig::Read(const wxString&,wxString*,const wxString&) const
|
||||
Read__12wxFileConfigCFRC8wxStringP8wxStringT1
|
||||
;wxFileConfig::RenameEntry(const wxString&,const wxString&)
|
||||
@ -1925,6 +1925,8 @@ EXPORTS
|
||||
Read__12wxFileConfigCFRC8wxStringP8wxString
|
||||
;wxFileConfigGroup::DeleteEntry(const char*)
|
||||
DeleteEntry__17wxFileConfigGroupFPCc
|
||||
;wxFileConfig::Parse(wxTextBuffer&,unsigned long)
|
||||
Parse__12wxFileConfigFR12wxTextBufferUl
|
||||
;wxFileConfig::wxFileConfig(const wxString&,const wxString&,const wxString&,const wxString&,long)
|
||||
__ct__12wxFileConfigFRC8wxStringN31l
|
||||
;wxFileConfigEntry::SetLine(wxFileConfigLineList*)
|
||||
@ -4582,8 +4584,8 @@ EXPORTS
|
||||
__ct__16wxStaticBoxSizerFP11wxStaticBoxi
|
||||
;wxGridSizer::wxGridSizer(int,int,int)
|
||||
__ct__11wxGridSizerFiN21
|
||||
;wxSizer::DoSetItemMinSize(wxWindow*,int,int)
|
||||
DoSetItemMinSize__7wxSizerFP8wxWindowiT2
|
||||
;wxSizer::DeleteWindows()
|
||||
DeleteWindows__7wxSizerFv
|
||||
;wxStaticBoxSizer::sm_classwxStaticBoxSizer
|
||||
sm_classwxStaticBoxSizer__16wxStaticBoxSizer
|
||||
;wxGridSizer::sm_classwxGridSizer
|
||||
@ -4596,6 +4598,8 @@ EXPORTS
|
||||
RecalcSizes__15wxFlexGridSizerFv
|
||||
;wxGridSizer::RecalcSizes()
|
||||
RecalcSizes__11wxGridSizerFv
|
||||
;wxSizer::DoSetItemMinSize(wxWindow*,int,int)
|
||||
DoSetItemMinSize__7wxSizerFP8wxWindowiT2
|
||||
;wxStaticBoxSizer::CalcMin()
|
||||
CalcMin__16wxStaticBoxSizerFv
|
||||
;wxFlexGridSizer::CalcMin()
|
||||
@ -4646,8 +4650,10 @@ EXPORTS
|
||||
Remove__7wxSizerFP8wxWindow
|
||||
;wxSizer::FitSize(wxWindow*)
|
||||
FitSize__7wxSizerFP8wxWindow
|
||||
__vft15wxNotebookSizer8wxObject
|
||||
;wxSizer::Clear(unsigned long)
|
||||
Clear__7wxSizerFUl
|
||||
__vft7wxSizer8wxObject
|
||||
__vft15wxNotebookSizer8wxObject
|
||||
;wxSizer::Remove(int)
|
||||
Remove__7wxSizerFi
|
||||
;wxSizer::GetMinSize()
|
||||
@ -4688,6 +4694,8 @@ EXPORTS
|
||||
Remove__7wxSizerFP7wxSizer
|
||||
;wxSizer::DoSetItemMinSize(wxSizer*,int,int)
|
||||
DoSetItemMinSize__7wxSizerFP7wxSizeriT2
|
||||
;wxSizerItem::DeleteWindows()
|
||||
DeleteWindows__11wxSizerItemFv
|
||||
;wxSizerItem::wxSizerItem(wxWindow*,int,int,int,wxObject*)
|
||||
__ct__11wxSizerItemFP8wxWindowiN22P8wxObject
|
||||
__vft16wxStaticBoxSizer8wxObject
|
||||
@ -5339,6 +5347,35 @@ EXPORTS
|
||||
__dt__13wxToolBarBaseFv
|
||||
;wxToolBarBase::SetToolLongHelp(int,const wxString&)
|
||||
SetToolLongHelp__13wxToolBarBaseFiRC8wxString
|
||||
;From object file: ..\common\textbuf.cpp
|
||||
;PUBDEFs (Symbols available from object file):
|
||||
;wxTextBuffer::GuessType() const
|
||||
GuessType__12wxTextBufferCFv
|
||||
;wxTextBuffer::Close()
|
||||
Close__12wxTextBufferFv
|
||||
;wxTextBuffer::Exists() const
|
||||
Exists__12wxTextBufferCFv
|
||||
__vft12wxTextBuffer
|
||||
;wxTextBuffer::Write(wxTextFileType,wxMBConv&)
|
||||
Write__12wxTextBufferF14wxTextFileTypeR8wxMBConv
|
||||
;wxTextBuffer::Open(const wxString&,wxMBConv&)
|
||||
Open__12wxTextBufferFRC8wxStringR8wxMBConv
|
||||
;wxTextBuffer::Create()
|
||||
Create__12wxTextBufferFv
|
||||
;wxTextBuffer::Translate(const wxString&,wxTextFileType)
|
||||
Translate__12wxTextBufferFRC8wxString14wxTextFileType
|
||||
;wxTextBuffer::~wxTextBuffer()
|
||||
__dt__12wxTextBufferFv
|
||||
;wxTextBuffer::wxTextBuffer(const wxString&)
|
||||
__ct__12wxTextBufferFRC8wxString
|
||||
;wxTextBuffer::typeDefault
|
||||
typeDefault__12wxTextBuffer
|
||||
;wxTextBuffer::GetEOL(wxTextFileType)
|
||||
GetEOL__12wxTextBufferF14wxTextFileType
|
||||
;wxTextBuffer::Open(wxMBConv&)
|
||||
Open__12wxTextBufferFR8wxMBConv
|
||||
;wxTextBuffer::Create(const wxString&)
|
||||
Create__12wxTextBufferFRC8wxString
|
||||
;From object file: ..\common\textcmn.cpp
|
||||
;PUBDEFs (Symbols available from object file):
|
||||
;wxTextCtrlBase::operator<<(double)
|
||||
@ -5367,6 +5404,8 @@ EXPORTS
|
||||
sm_classwxTextUrlEvent__14wxTextUrlEvent
|
||||
;wxTextCtrlBase::~wxTextCtrlBase()
|
||||
__dt__14wxTextCtrlBaseFv
|
||||
;wxTextCtrlBase::GetStringSelection() const
|
||||
GetStringSelection__14wxTextCtrlBaseCFv
|
||||
;wxTextCtrlBase::GetDefaultStyle() const
|
||||
GetDefaultStyle__14wxTextCtrlBaseCFv
|
||||
;wxTextCtrlBase::CanPaste() const
|
||||
@ -5386,34 +5425,19 @@ EXPORTS
|
||||
SetStyle__14wxTextCtrlBaseFlT1RC10wxTextAttr
|
||||
;From object file: ..\common\textfile.cpp
|
||||
;PUBDEFs (Symbols available from object file):
|
||||
;wxTextFile::Read(wxMBConv&)
|
||||
Read__10wxTextFileFR8wxMBConv
|
||||
;wxTextFile::GuessType() const
|
||||
GuessType__10wxTextFileCFv
|
||||
;wxTextFile::~wxTextFile()
|
||||
__dt__10wxTextFileFv
|
||||
;wxTextFile::typeDefault
|
||||
typeDefault__10wxTextFile
|
||||
;wxTextFile::Exists() const
|
||||
Exists__10wxTextFileCFv
|
||||
;wxTextFile::Create()
|
||||
Create__10wxTextFileFv
|
||||
;wxTextFile::GetEOL(wxTextFileType)
|
||||
GetEOL__10wxTextFileF14wxTextFileType
|
||||
;wxTextFile::Translate(const wxString&,wxTextFileType)
|
||||
Translate__10wxTextFileFRC8wxString14wxTextFileType
|
||||
;wxTextFile::Open(const wxString&,wxMBConv&)
|
||||
Open__10wxTextFileFRC8wxStringR8wxMBConv
|
||||
;wxTextFile::Write(wxTextFileType,wxMBConv&)
|
||||
Write__10wxTextFileF14wxTextFileTypeR8wxMBConv
|
||||
;wxTextFile::Open(wxMBConv&)
|
||||
Open__10wxTextFileFR8wxMBConv
|
||||
;wxTextFile::Close()
|
||||
Close__10wxTextFileFv
|
||||
;wxTextFile::OnRead(wxMBConv&)
|
||||
OnRead__10wxTextFileFR8wxMBConv
|
||||
__vft10wxTextFile12wxTextBuffer
|
||||
;wxTextFile::OnOpen(const wxString&,wxTextBuffer::wxTextBufferOpenMode)
|
||||
OnOpen__10wxTextFileFRC8wxStringQ2_12wxTextBuffer20wxTextBufferOpenMode
|
||||
;wxTextFile::OnExists() const
|
||||
OnExists__10wxTextFileCFv
|
||||
;wxTextFile::OnClose()
|
||||
OnClose__10wxTextFileFv
|
||||
;wxTextFile::OnWrite(wxTextFileType,wxMBConv&)
|
||||
OnWrite__10wxTextFileF14wxTextFileTypeR8wxMBConv
|
||||
;wxTextFile::wxTextFile(const wxString&)
|
||||
__ct__10wxTextFileFRC8wxString
|
||||
;wxTextFile::Create(const wxString&)
|
||||
Create__10wxTextFileFRC8wxString
|
||||
;From object file: ..\common\timercmn.cpp
|
||||
;PUBDEFs (Symbols available from object file):
|
||||
;wxTimerEvent::sm_classwxTimerEvent
|
||||
@ -5585,7 +5609,7 @@ EXPORTS
|
||||
Read32__17wxTextInputStreamFv
|
||||
;wxTextInputStream::SkipIfEndOfLine(char)
|
||||
SkipIfEndOfLine__17wxTextInputStreamFc
|
||||
;From object file: F:\DEV\WX2\WXWINDOWS\src\common\unzip.c
|
||||
;From object file: H:\DEV\WX2\WXWINDOWS\src\common\unzip.c
|
||||
;PUBDEFs (Symbols available from object file):
|
||||
unzReadCurrentFile
|
||||
unzGetCurrentFileInfo
|
||||
@ -8591,6 +8615,8 @@ EXPORTS
|
||||
GetItemCount__10wxListCtrlCFv
|
||||
;wxListMainWindow::GetImageSize(int,int&,int&) const
|
||||
GetImageSize__16wxListMainWindowCFiRiT2
|
||||
;wxListCtrl::Freeze()
|
||||
Freeze__10wxListCtrlFv
|
||||
;wxListHeaderWindow::DoDrawRect(wxDC*,int,int,int,int)
|
||||
DoDrawRect__18wxListHeaderWindowFP4wxDCiN32
|
||||
wxEVT_COMMAND_LIST_COL_BEGIN_DRAG
|
||||
@ -8770,6 +8796,10 @@ EXPORTS
|
||||
__vft16wxListMainWindow14wxScrollHelper
|
||||
;wxListMainWindow::UpdateCurrent()
|
||||
UpdateCurrent__16wxListMainWindowFv
|
||||
;wxListMainWindow::Thaw()
|
||||
Thaw__16wxListMainWindowFv
|
||||
;wxListCtrl::Thaw()
|
||||
Thaw__10wxListCtrlFv
|
||||
;wxListCtrl::SetItem(long,int,const wxString&,int)
|
||||
SetItem__10wxListCtrlFliRC8wxStringT2
|
||||
;wxListMainWindow::InitScrolling()
|
||||
@ -8794,6 +8824,8 @@ EXPORTS
|
||||
GetBackgroundColour__10wxListCtrlCFv
|
||||
;wxListLineData::GetAttr() const
|
||||
GetAttr__14wxListLineDataCFv
|
||||
;wxListMainWindow::Freeze()
|
||||
Freeze__16wxListMainWindowFv
|
||||
;wxListCtrl::CreateHeaderWindow()
|
||||
CreateHeaderWindow__10wxListCtrlFv
|
||||
;wxListLineData::SetText(int,const wxString)
|
||||
@ -11262,6 +11294,8 @@ EXPORTS
|
||||
sm_classwxChoice__8wxChoice
|
||||
;wxChoice::DoGetItemClientObject(int) const
|
||||
DoGetItemClientObject__8wxChoiceCFi
|
||||
;wxChoice::Free()
|
||||
Free__8wxChoiceFv
|
||||
;wxChoice::GetCount() const
|
||||
GetCount__8wxChoiceCFv
|
||||
;wxChoice::SetString(int,const wxString&)
|
||||
@ -11359,6 +11393,8 @@ EXPORTS
|
||||
SetEditable__10wxComboBoxFUl
|
||||
;wxComboBox::SetInsertionPointEnd()
|
||||
SetInsertionPointEnd__10wxComboBoxFv
|
||||
;wxComboBox::ProcessEditMsg(unsigned int,void*,void*)
|
||||
ProcessEditMsg__10wxComboBoxFUiPvT2
|
||||
;wxComboBox::SetValue(const wxString&)
|
||||
SetValue__10wxComboBoxFRC8wxString
|
||||
;wxComboBox::SetInsertionPoint(long)
|
||||
@ -11371,6 +11407,7 @@ EXPORTS
|
||||
wxConstructorForwxComboBox__Fv
|
||||
;wxComboBox::Create(wxWindow*,int,const wxString&,const wxPoint&,const wxSize&,int,const wxString*,long,const wxValidator&,const wxString&)
|
||||
Create__10wxComboBoxFP8wxWindowiRC8wxStringRC7wxPointRC6wxSizeT2PC8wxStringlRC11wxValidatorT3
|
||||
wxComboEditWndProc
|
||||
;wxComboBox::OS2Command(unsigned int,unsigned short)
|
||||
OS2Command__10wxComboBoxFUiUs
|
||||
;From object file: ..\os2\control.cpp
|
||||
@ -11404,6 +11441,8 @@ EXPORTS
|
||||
__vft9wxControl8wxObject
|
||||
;wxControl::~wxControl()
|
||||
__dt__9wxControlFv
|
||||
;wxControl::OS2CreateControl(wxWindow*,int,const wxPoint&,const wxSize&,long,const wxValidator&,const wxString&)
|
||||
OS2CreateControl__9wxControlFP8wxWindowiRC7wxPointRC6wxSizelRC11wxValidatorRC8wxString
|
||||
;From object file: ..\os2\cursor.cpp
|
||||
;PUBDEFs (Symbols available from object file):
|
||||
;wxCursorRefData::~wxCursorRefData()
|
||||
|
Loading…
Reference in New Issue
Block a user