📄 uart_widget.h
字号:
/////////////////////////////////////////////////////////////////////////////
// Name: UART_Widget.h
// Purpose:
// Author: GeJun Shen <dragonsn@163.com>
// Modified by:
// Created: 03/08/05 15:48:55
// RCS-ID:
// Copyright: GNU Public Licence
// Licence:
/////////////////////////////////////////////////////////////////////////////
#ifndef _UART_WIDGET_H_
#define _UART_WIDGET_H_
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "UART_Widget.cpp"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/frame.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
namespace LCD {
////@begin control identifiers
#define ID_FRAME 10000
#define SYMBOL_UART_WIDGET_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_UART_WIDGET_TITLE _("UART Screen")
#define SYMBOL_UART_WIDGET_IDNAME ID_FRAME
#define SYMBOL_UART_WIDGET_SIZE wxSize(400, 300)
#define SYMBOL_UART_WIDGET_POSITION wxDefaultPosition
#define ID_TEXTCTRL 10002
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
#ifndef wxFIXED_MINSIZE
#define wxFIXED_MINSIZE 0
#endif
/*!
* My TextCtrl that override onchar
*/
class MyTextCtrl : public wxTextCtrl
{
DECLARE_DYNAMIC_CLASS( MyTextCtrl )
DECLARE_EVENT_TABLE()
public:
MyTextCtrl(wxWindow *parent, wxWindowID id, const wxString &value,
const wxPoint &pos, const wxSize &size, int style = 0)
: wxTextCtrl(parent, id, value, pos, size, style)
{
}
MyTextCtrl()
{}
void OnChar(wxKeyEvent &event);
};
/*!
* UART_Widget class declaration
*/
class UART_Widget: public wxFrame
{
DECLARE_CLASS( UART_Widget )
DECLARE_EVENT_TABLE()
public:
/// Constructors
UART_Widget( );
UART_Widget( wxWindow* parent, wxWindowID id = SYMBOL_UART_WIDGET_IDNAME, const wxString& caption = SYMBOL_UART_WIDGET_TITLE, const wxPoint& pos = SYMBOL_UART_WIDGET_POSITION, const wxSize& size = SYMBOL_UART_WIDGET_SIZE, long style = SYMBOL_UART_WIDGET_STYLE );
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_UART_WIDGET_IDNAME, const wxString& caption = SYMBOL_UART_WIDGET_TITLE, const wxPoint& pos = SYMBOL_UART_WIDGET_POSITION, const wxSize& size = SYMBOL_UART_WIDGET_SIZE, long style = SYMBOL_UART_WIDGET_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin UART_Widget event handler declarations
////@end UART_Widget event handler declarations
////@begin UART_Widget member function declarations
void OnClose( wxCloseEvent &event);
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end UART_Widget member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin UART_Widget member variables
////@end UART_Widget member variables
public:
MyTextCtrl * m_textctrl;
};
}
#endif
// _UART_WIDGET_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -