📄 lcd_widget.cpp
字号:
/////////////////////////////////////////////////////////////////////////////
// Name: LCD_Widget.cpp
// Purpose:
// Author: Huacheng Ke <sese_zju@yahoo.com.cn>
// Modified by:
// Created: 03/08/05 15:48:55
// RCS-ID:
// Copyright: GNU Public Licence
// Licence:
/////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "LCD_Widget.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "LCD_Widget.h"
#include "Core/Observer.h"
////@begin XPM images
////@end XPM images
#include <Core/Helper.h>
#include <Core/System.h>
#include <memory.h>
namespace LCD {
/*!
* LCD_Widget type definition
*/
IMPLEMENT_CLASS( LCD_Widget, wxFrame )
BEGIN_EVENT_TABLE( LCD_Widget, wxFrame )
EVT_TIMER(TIMER_ID1, LCD_Widget::OnTimer)
END_EVENT_TABLE()
/*!
* LCD_Widget constructors
*/
LCD_Widget::LCD_Widget()
{
//obv_ = observer;
}
LCD_Widget::LCD_Widget( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style)
:timer_(this, TIMER_ID1)
{
Create( parent, id, caption, pos, size, style );
//obv_ = observer;
//timer_.Start(500);
}
/*!
* LCD_Widget creator
*/
bool LCD_Widget::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin LCD_Widget member initialisation
////@end LCD_Widget member initialisation
////@begin LCD_Widget creation
wxFrame::Create( parent, id, caption, pos, size, style );
CreateControls();
/*GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);*/
Centre();
////@end LCD_Widget creation
return TRUE;
}
/*!
* Control creation for LCD_Widget
*/
void LCD_Widget::CreateControls()
{
/*std::string filepath
= Core::Host_Machine::gen_fullpath(Core::Host_Machine::get_plugin_path(), "LCD.XRC");*/
// wxXmlResource::Get()->Load(filepath.c_str());
////@begin LCD_Widget content construction
LCD_Widget* itemFrame1 = this;
/* wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
itemFrame1->SetSizer(itemBoxSizer4);
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer4->Add(itemBoxSizer5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxTextCtrl* itemTextCtrl6 = new wxTextCtrl( itemFrame1, ID_TEXTCTRL, _("Welcome to Linux (2.6.10)...\n"), wxDefaultPosition, wxSize(240, 360), wxTE_MULTILINE );
itemTextCtrl6->SetForegroundColour(wxColour(224, 224, 224));
itemTextCtrl6->SetBackgroundColour(wxColour(0, 0, 0));
itemBoxSizer5->Add(itemTextCtrl6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);*/
/*wxMenuBar* menuBar = new wxMenuBar;
wxMenu* itemMenu3 = new wxMenu;
menuBar->Append(itemMenu3, _("File"));
itemFrame1->SetMenuBar(menuBar);*/
////@end LCD_Widget content construction
// Create custom windows not generated automatically here.
////@begin LCD_Widget content initialisation
////@end LCD_Widget content initialisation
}
/*!
* Should we show tooltips?
*/
bool LCD_Widget::ShowToolTips()
{
return TRUE;
}
/*!
* Get bitmap resources
*/
wxBitmap LCD_Widget::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin LCD_Widget bitmap retrieval
return wxNullBitmap;
////@end LCD_Widget bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon LCD_Widget::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin LCD_Widget icon retrieval
return wxNullIcon;
////@end LCD_Widget icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON
*/
void LCD_Widget::OnTimer(wxTimerEvent& event)
{
//temp
//obv_->update(*Core::Wukong_Get_System().get_device("LCD_"));
}
void LCD_Widget::start_timer(int time)
{
timer_.Start(time);
}
} //namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -