more files added

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-08-14 19:08:46 +00:00
parent c9278366ee
commit 255792efdb
6 changed files with 444 additions and 0 deletions

79
src/univ/control.cpp Normal file
View File

@@ -0,0 +1,79 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/univ/control.cpp
// Purpose: universal wxControl: adds handling of mnemonics
// Author: Vadim Zeitlin
// Modified by:
// Created: 14.08.00
// RCS-ID: $Id$
// Copyright: (c) 2000 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
#ifdef __GNUG__
#pragma implementation "control.h"
#endif
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if wxUSE_CONTROLS
#ifndef WX_PRECOMP
#include "wx/control.h"
#endif
// ============================================================================
// implementation
// ============================================================================
IMPLEMENT_DYNAMIC_CLASS(wxControl, wxWindow)
// ----------------------------------------------------------------------------
// creation
// ----------------------------------------------------------------------------
wxControl::wxControl()
{
}
// ----------------------------------------------------------------------------
// mnemonics handling
// ----------------------------------------------------------------------------
void wxControl::SetLabel( const wxString &label )
{
// the character following MNEMONIC_PREFIX is the accelerator for this
// control unless it is MNEMONIC_PREFIX too - this allows to insert
// literal MNEMONIC_PREFIX chars into the label
static const wxChar MNEMONIC_PREFIX = _T('&');
m_label.Empty();
for ( const wxChar *pc = label; *pc != wxT('\0'); pc++ )
{
if ( *pc == MNEMONIC_PREFIX )
{
pc++; // skip it
if ( *pc != MNEMONIC_PREFIX )
m_chAccel = *pc;
}
m_label << *pc;
}
}
wxString wxControl::GetLabel() const
{
return m_label;
}
#endif // wxUSE_CONTROLS