no message
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14765 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -384,7 +384,7 @@ bool wxBitmap::LoadFile(
|
|||||||
if (!vImage.LoadFile(rFilename, lType) || !vImage.Ok() )
|
if (!vImage.LoadFile(rFilename, lType) || !vImage.Ok() )
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
|
|
||||||
*this = vImage.ConvertToBitmap();
|
*this = wxBitmap(vImage);
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@@ -444,7 +444,7 @@ bool wxBitmap::SaveFile(
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// FIXME what about palette? shouldn't we use it?
|
// FIXME what about palette? shouldn't we use it?
|
||||||
wxImage vImage(*this);
|
wxImage vImage = ConvertToImage();
|
||||||
|
|
||||||
if (!vImage.Ok())
|
if (!vImage.Ok())
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
|
@@ -398,8 +398,64 @@ bool wxMenu::DoAppend(
|
|||||||
wxMenuItem* pItem
|
wxMenuItem* pItem
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return wxMenuBase::DoAppend(pItem) && DoInsertOrAppend(pItem);
|
wxCHECK_MSG( pItem, FALSE, _T("NULL item in wxMenu::DoAppend") );
|
||||||
}
|
|
||||||
|
bool bCheck = FALSE;
|
||||||
|
|
||||||
|
if (pItem->GetKind() == wxITEM_RADIO)
|
||||||
|
{
|
||||||
|
int nCount = GetMenuItemCount();
|
||||||
|
|
||||||
|
if (m_lStartRadioGroup == -1)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Start a new radio group
|
||||||
|
//
|
||||||
|
m_lStartRadioGroup = lCount;
|
||||||
|
|
||||||
|
//
|
||||||
|
// For now it has just one element
|
||||||
|
//
|
||||||
|
pItem->SetAsRadioGroupStart();
|
||||||
|
pItem->SetRadioGroupEnd(m_startRadioGroup);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Ensure that we have a checked item in the radio group
|
||||||
|
//
|
||||||
|
bCheck = TRUE;
|
||||||
|
}
|
||||||
|
else // extend the current radio group
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// We need to update its end item
|
||||||
|
//
|
||||||
|
pItem->SetRadioGroupStart(m_lStartRadioGroup);
|
||||||
|
wxMenuItemList::Node *node = GetMenuItems().Item(m_startRadioGroup);
|
||||||
|
|
||||||
|
if (node)
|
||||||
|
{
|
||||||
|
node->GetData()->SetRadioGroupEnd(count);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( _T("where is the radio group start item?") );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // not a radio item
|
||||||
|
{
|
||||||
|
EndRadioGroup();
|
||||||
|
}
|
||||||
|
if (!wxMenuBase::DoAppend(pItem) || !DoInsertOrAppend(pItem))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (bCheck)
|
||||||
|
{
|
||||||
|
pItem->Check(TRUE);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
} // end of wxMenu::DoInsert
|
||||||
|
|
||||||
bool wxMenu::DoInsert(
|
bool wxMenu::DoInsert(
|
||||||
size_t nPos
|
size_t nPos
|
||||||
|
@@ -122,29 +122,50 @@ wxMenuItem::wxMenuItem(
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG(pParentMenu != NULL, wxT("a menu item should have a parent"));
|
wxASSERT_MSG(pParentMenu != NULL, wxT("a menu item should have a parent"));
|
||||||
|
|
||||||
#if wxUSE_OWNER_DRAWN
|
Init();
|
||||||
|
} // end of wxMenuItem::wxMenuItem
|
||||||
|
|
||||||
//
|
wxMenuItem::wxMenuItem(
|
||||||
// Set default menu colors
|
wxMenu* pParentMenu
|
||||||
//
|
, int nId
|
||||||
|
, const wxString& rText
|
||||||
|
, const wxString& rStrHelp
|
||||||
|
, bool bIsCheckable
|
||||||
|
, wxMenu* pSubMenu
|
||||||
|
)
|
||||||
|
: wxMenuItemBase(pParentMenu, nId, rText, rStrHelp, bIsCheckable ? kITEM_CHECK : kITEM_NORMAL, pSubMenu)
|
||||||
|
#if wxUSE_OWNER_DRAWN
|
||||||
|
, wxOwnerDrawn( TextToLabel(rText)
|
||||||
|
,bCheckable
|
||||||
|
)
|
||||||
|
#endif // owner drawn
|
||||||
|
{
|
||||||
|
wxASSERT_MSG(pParentMenu != NULL, wxT("a menu item should have a parent"));
|
||||||
|
|
||||||
|
Init();
|
||||||
|
} // end of wxMenuItem::wxMenuItem
|
||||||
|
|
||||||
|
void wxMenuItem::Init()
|
||||||
|
{
|
||||||
|
m_radioGroup.start = -1;
|
||||||
|
m_isRadioGroupStart = FALSE;
|
||||||
|
|
||||||
|
#if wxUSE_OWNER_DRAWN
|
||||||
|
// set default menu colors
|
||||||
#define SYS_COLOR(c) (wxSystemSettings::GetColour(wxSYS_COLOUR_##c))
|
#define SYS_COLOR(c) (wxSystemSettings::GetColour(wxSYS_COLOUR_##c))
|
||||||
|
|
||||||
SetTextColour(SYS_COLOR(MENUTEXT));
|
SetTextColour(SYS_COLOR(MENUTEXT));
|
||||||
SetBackgroundColour(SYS_COLOR(MENU));
|
SetBackgroundColour(SYS_COLOR(MENU));
|
||||||
|
|
||||||
//
|
#undef SYS_COLOR
|
||||||
// We don't want normal items be owner-drawn
|
|
||||||
//
|
// we don't want normal items be owner-drawn
|
||||||
ResetOwnerDrawn();
|
ResetOwnerDrawn();
|
||||||
|
|
||||||
#undef SYS_COLOR
|
// tell the owner drawing code to to show the accel string as well
|
||||||
|
SetAccelString(m_text.AfterFirst(_T('\t')));
|
||||||
#endif // wxUSE_OWNER_DRAWN
|
#endif // wxUSE_OWNER_DRAWN
|
||||||
|
}
|
||||||
m_text = TextToLabel(rText);
|
|
||||||
|
|
||||||
memset(&m_vMenuData, '\0', sizeof(m_vMenuData));
|
|
||||||
m_vMenuData.id= nId;
|
|
||||||
} // end of wxMenuItem::wxMenuItem
|
|
||||||
|
|
||||||
wxMenuItem::~wxMenuItem()
|
wxMenuItem::~wxMenuItem()
|
||||||
{
|
{
|
||||||
@@ -195,6 +216,34 @@ wxString wxMenuItemBase::GetLabelFromText(
|
|||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// radio group stuff
|
||||||
|
// -----------------
|
||||||
|
|
||||||
|
void wxMenuItem::SetAsRadioGroupStart()
|
||||||
|
{
|
||||||
|
m_bIsRadioGroupStart = TRUE;
|
||||||
|
} // end of wxMenuItem::SetAsRadioGroupStart
|
||||||
|
|
||||||
|
void wxMenuItem::SetRadioGroupStart(
|
||||||
|
int nStart
|
||||||
|
)
|
||||||
|
{
|
||||||
|
wxASSERT_MSG( !m_bIsRadioGroupStart,
|
||||||
|
_T("should only be called for the next radio items") );
|
||||||
|
|
||||||
|
m_vRadioGroup.m_nStart = nStart;
|
||||||
|
} // end of wxMenuItem::SetRadioGroupStart
|
||||||
|
|
||||||
|
void wxMenuItem::SetRadioGroupEnd(
|
||||||
|
int nEnd
|
||||||
|
)
|
||||||
|
{
|
||||||
|
wxASSERT_MSG( m_bIsRadioGroupStart,
|
||||||
|
_T("should only be called for the first radio item") );
|
||||||
|
|
||||||
|
m_vRadioGroup.m_nEnd = nEnd;
|
||||||
|
} // end of wxMenuItem::SetRadioGroupEnd
|
||||||
|
|
||||||
// change item state
|
// change item state
|
||||||
// -----------------
|
// -----------------
|
||||||
|
|
||||||
@@ -234,6 +283,7 @@ void wxMenuItem::Check(
|
|||||||
wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") );
|
wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") );
|
||||||
if (m_isChecked == bCheck)
|
if (m_isChecked == bCheck)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (bCheck)
|
if (bCheck)
|
||||||
bOk = (bool)::WinSendMsg( GetHMenuOf(m_parentMenu)
|
bOk = (bool)::WinSendMsg( GetHMenuOf(m_parentMenu)
|
||||||
,MM_SETITEMATTR
|
,MM_SETITEMATTR
|
||||||
|
@@ -4,7 +4,7 @@ DATA MULTIPLE NONSHARED READWRITE LOADONCALL
|
|||||||
CODE LOADONCALL
|
CODE LOADONCALL
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
;From library: H:\dev\wx2\wxwindows\lib\wx.lib
|
;From library: F:\DEV\WX2\WXWINDOWS\LIB\wx.lib
|
||||||
;From object file: dummy.cpp
|
;From object file: dummy.cpp
|
||||||
;PUBDEFs (Symbols available from object file):
|
;PUBDEFs (Symbols available from object file):
|
||||||
wxDummyChar
|
wxDummyChar
|
||||||
@@ -1878,7 +1878,7 @@ EXPORTS
|
|||||||
wxEVT_NC_LEFT_DCLICK
|
wxEVT_NC_LEFT_DCLICK
|
||||||
wxEVT_INIT_DIALOG
|
wxEVT_INIT_DIALOG
|
||||||
wxEVT_COMMAND_SET_FOCUS
|
wxEVT_COMMAND_SET_FOCUS
|
||||||
;From object file: H:\DEV\WX2\WXWINDOWS\src\common\extended.c
|
;From object file: F:\DEV\WX2\WXWINDOWS\src\common\extended.c
|
||||||
;PUBDEFs (Symbols available from object file):
|
;PUBDEFs (Symbols available from object file):
|
||||||
ConvertToIeeeExtended
|
ConvertToIeeeExtended
|
||||||
ConvertFromIeeeExtended
|
ConvertFromIeeeExtended
|
||||||
@@ -3334,44 +3334,44 @@ EXPORTS
|
|||||||
LoadFile__12wxXPMHandlerFP7wxImageR13wxInputStreamUli
|
LoadFile__12wxXPMHandlerFP7wxImageR13wxInputStreamUli
|
||||||
;From object file: ..\common\intl.cpp
|
;From object file: ..\common\intl.cpp
|
||||||
;PUBDEFs (Symbols available from object file):
|
;PUBDEFs (Symbols available from object file):
|
||||||
|
;wxMsgCatalogFile::FillHash(wxMessagesHash&,unsigned long) const
|
||||||
|
FillHash__16wxMsgCatalogFileCFR14wxMessagesHashUl
|
||||||
;wxLocale::Init(int,int)
|
;wxLocale::Init(int,int)
|
||||||
Init__8wxLocaleFiT1
|
Init__8wxLocaleFiT1
|
||||||
;wxLocaleModule::sm_classwxLocaleModule
|
;wxLocaleModule::sm_classwxLocaleModule
|
||||||
sm_classwxLocaleModule__14wxLocaleModule
|
sm_classwxLocaleModule__14wxLocaleModule
|
||||||
;wxLanguageInfoArray::Insert(const wxLanguageInfo&,unsigned int)
|
;wxLanguageInfoArray::Insert(const wxLanguageInfo&,unsigned int)
|
||||||
Insert__19wxLanguageInfoArrayFRC14wxLanguageInfoUi
|
Insert__19wxLanguageInfoArrayFRC14wxLanguageInfoUi
|
||||||
;wxMsgCatalog::wxMsgCatalog()
|
;wxLocale::GetSystemEncoding()
|
||||||
__ct__12wxMsgCatalogFv
|
GetSystemEncoding__8wxLocaleFv
|
||||||
;wxLocale::~wxLocale()
|
;wxLocale::~wxLocale()
|
||||||
__dt__8wxLocaleFv
|
__dt__8wxLocaleFv
|
||||||
;wxLocale::GetSystemLanguage()
|
;wxLocale::GetSystemLanguage()
|
||||||
GetSystemLanguage__8wxLocaleFv
|
GetSystemLanguage__8wxLocaleFv
|
||||||
;wxLocale::GetSystemEncoding()
|
|
||||||
GetSystemEncoding__8wxLocaleFv
|
|
||||||
;wxLocale::CreateLanguagesDB()
|
;wxLocale::CreateLanguagesDB()
|
||||||
CreateLanguagesDB__8wxLocaleFv
|
CreateLanguagesDB__8wxLocaleFv
|
||||||
;wxLanguageInfoArray::Index(const wxLanguageInfo&,unsigned long) const
|
;wxLanguageInfoArray::Index(const wxLanguageInfo&,unsigned long) const
|
||||||
Index__19wxLanguageInfoArrayCFRC14wxLanguageInfoUl
|
Index__19wxLanguageInfoArrayCFRC14wxLanguageInfoUl
|
||||||
;wxLanguageInfoArray::wxLanguageInfoArray(const wxLanguageInfoArray&)
|
;wxLanguageInfoArray::wxLanguageInfoArray(const wxLanguageInfoArray&)
|
||||||
__ct__19wxLanguageInfoArrayFRC19wxLanguageInfoArray
|
__ct__19wxLanguageInfoArrayFRC19wxLanguageInfoArray
|
||||||
;wxMsgCatalog::~wxMsgCatalog()
|
;wxMsgCatalogFile::~wxMsgCatalogFile()
|
||||||
__dt__12wxMsgCatalogFv
|
__dt__16wxMsgCatalogFileFv
|
||||||
;wxConstructorForwxLocaleModule()
|
;wxConstructorForwxLocaleModule()
|
||||||
wxConstructorForwxLocaleModule__Fv
|
wxConstructorForwxLocaleModule__Fv
|
||||||
;wxLocale::GetSysName() const
|
;wxLocale::GetSysName() const
|
||||||
GetSysName__8wxLocaleCFv
|
GetSysName__8wxLocaleCFv
|
||||||
;wxLanguageInfoArray::DoEmpty()
|
;wxLanguageInfoArray::DoEmpty()
|
||||||
DoEmpty__19wxLanguageInfoArrayFv
|
DoEmpty__19wxLanguageInfoArrayFv
|
||||||
;wxMsgCatalog::ConvertEncoding()
|
|
||||||
ConvertEncoding__12wxMsgCatalogFv
|
|
||||||
;wxLocale::AddCatalog(const char*)
|
;wxLocale::AddCatalog(const char*)
|
||||||
AddCatalog__8wxLocaleFPCc
|
AddCatalog__8wxLocaleFPCc
|
||||||
;wxMsgCatalog::Load(const char*,const char*,unsigned long)
|
;wxMsgCatalog::Load(const char*,const char*,unsigned long)
|
||||||
Load__12wxMsgCatalogFPCcT1Ul
|
Load__12wxMsgCatalogFPCcT1Ul
|
||||||
;wxLocale::InitLanguagesDB()
|
;wxMsgCatalogFile::wxMsgCatalogFile()
|
||||||
InitLanguagesDB__8wxLocaleFv
|
__ct__16wxMsgCatalogFileFv
|
||||||
;wxLocale::wxLocale()
|
;wxLocale::wxLocale()
|
||||||
__ct__8wxLocaleFv
|
__ct__8wxLocaleFv
|
||||||
|
;wxLocale::InitLanguagesDB()
|
||||||
|
InitLanguagesDB__8wxLocaleFv
|
||||||
;wxLocale::GetSystemEncodingName()
|
;wxLocale::GetSystemEncodingName()
|
||||||
GetSystemEncodingName__8wxLocaleFv
|
GetSystemEncodingName__8wxLocaleFv
|
||||||
;wxLanguageInfoArray::Add(const wxLanguageInfo&)
|
;wxLanguageInfoArray::Add(const wxLanguageInfo&)
|
||||||
@@ -3384,12 +3384,16 @@ EXPORTS
|
|||||||
GetString__8wxLocaleCFPCcT1
|
GetString__8wxLocaleCFPCcT1
|
||||||
;wxLocale::ms_languagesDB
|
;wxLocale::ms_languagesDB
|
||||||
ms_languagesDB__8wxLocale
|
ms_languagesDB__8wxLocale
|
||||||
|
;wxMsgCatalogFile::Load(const char*,const char*)
|
||||||
|
Load__16wxMsgCatalogFileFPCcT1
|
||||||
;wxGetLocale()
|
;wxGetLocale()
|
||||||
wxGetLocale__Fv
|
wxGetLocale__Fv
|
||||||
;NoTransErr::ms_suppressCount
|
;NoTransErr::ms_suppressCount
|
||||||
ms_suppressCount__10NoTransErr
|
ms_suppressCount__10NoTransErr
|
||||||
;wxLanguageInfoArray::~wxLanguageInfoArray()
|
;wxLanguageInfoArray::~wxLanguageInfoArray()
|
||||||
__dt__19wxLanguageInfoArrayFv
|
__dt__19wxLanguageInfoArrayFv
|
||||||
|
;wxMsgCatalogFile::GetCharset() const
|
||||||
|
GetCharset__16wxMsgCatalogFileCFv
|
||||||
;wxLocale::DestroyLanguagesDB()
|
;wxLocale::DestroyLanguagesDB()
|
||||||
DestroyLanguagesDB__8wxLocaleFv
|
DestroyLanguagesDB__8wxLocaleFv
|
||||||
;wxMsgCatalog::GetString(const char*) const
|
;wxMsgCatalog::GetString(const char*) const
|
||||||
@@ -3402,12 +3406,10 @@ EXPORTS
|
|||||||
__as__19wxLanguageInfoArrayFRC19wxLanguageInfoArray
|
__as__19wxLanguageInfoArrayFRC19wxLanguageInfoArray
|
||||||
;wxLanguageInfoArray::RemoveAt(unsigned int)
|
;wxLanguageInfoArray::RemoveAt(unsigned int)
|
||||||
RemoveAt__19wxLanguageInfoArrayFUi
|
RemoveAt__19wxLanguageInfoArrayFUi
|
||||||
;wxMsgCatalog::GetHash(const char*)
|
|
||||||
GetHash__12wxMsgCatalogFPCc
|
|
||||||
;wxLocale::IsLoaded(const char*) const
|
|
||||||
IsLoaded__8wxLocaleCFPCc
|
|
||||||
;wxLocale::AddCatalogLookupPathPrefix(const wxString&)
|
;wxLocale::AddCatalogLookupPathPrefix(const wxString&)
|
||||||
AddCatalogLookupPathPrefix__8wxLocaleFRC8wxString
|
AddCatalogLookupPathPrefix__8wxLocaleFRC8wxString
|
||||||
|
;wxLocale::IsLoaded(const char*) const
|
||||||
|
IsLoaded__8wxLocaleCFPCc
|
||||||
;From object file: ..\common\ipcbase.cpp
|
;From object file: ..\common\ipcbase.cpp
|
||||||
;PUBDEFs (Symbols available from object file):
|
;PUBDEFs (Symbols available from object file):
|
||||||
;wxConnectionBase::sm_classwxConnectionBase
|
;wxConnectionBase::sm_classwxConnectionBase
|
||||||
@@ -5929,7 +5931,7 @@ EXPORTS
|
|||||||
Read32__17wxTextInputStreamFv
|
Read32__17wxTextInputStreamFv
|
||||||
;wxTextInputStream::SkipIfEndOfLine(char)
|
;wxTextInputStream::SkipIfEndOfLine(char)
|
||||||
SkipIfEndOfLine__17wxTextInputStreamFc
|
SkipIfEndOfLine__17wxTextInputStreamFc
|
||||||
;From object file: H:\DEV\WX2\WXWINDOWS\src\common\unzip.c
|
;From object file: F:\DEV\WX2\WXWINDOWS\src\common\unzip.c
|
||||||
;PUBDEFs (Symbols available from object file):
|
;PUBDEFs (Symbols available from object file):
|
||||||
unzReadCurrentFile
|
unzReadCurrentFile
|
||||||
unzGetCurrentFileInfo
|
unzGetCurrentFileInfo
|
||||||
|
Reference in New Issue
Block a user