Work continues...
Main application bar frame replaced with wxDialog GUI now created using wxFormBuilder Stale main.cpp removed
This commit is contained in:
parent
aa82a62774
commit
1e8e71b0fb
281
ZRCola/ZRCola.fbp
Normal file
281
ZRCola/ZRCola.fbp
Normal file
@ -0,0 +1,281 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="13" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">zrcolagui</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">wxHelpControllerHelpProvider</property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">ZRCola</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header">#include "stdafx.h"</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_enum">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="center">wxBOTH</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">wxZRColaDialogBase</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">500,200</property>
|
||||
<property name="style">wxCAPTION|wxCLOSE_BOX|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU</property>
|
||||
<property name="subclass">; </property>
|
||||
<property name="title">ZRCola</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnActivate"></event>
|
||||
<event name="OnActivateApp"></event>
|
||||
<event name="OnAuiFindManager"></event>
|
||||
<event name="OnAuiPaneButton"></event>
|
||||
<event name="OnAuiPaneClose"></event>
|
||||
<event name="OnAuiPaneMaximize"></event>
|
||||
<event name="OnAuiPaneRestore"></event>
|
||||
<event name="OnAuiRender"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnClose">OnClose</event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnHibernate"></event>
|
||||
<event name="OnIconize"></event>
|
||||
<event name="OnIdle"></event>
|
||||
<event name="OnInitDialog"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<property name="minimum_size">100,100</property>
|
||||
<property name="name">bSizerEditor</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">50</property>
|
||||
<object class="wxTextCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font">00 ZRCola,90,90,20,70,0</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_DECOMPOSED</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_decomposed</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTE_CENTRE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText">OnDecomposedText</event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">50</property>
|
||||
<object class="wxTextCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font">00 ZRCola,90,90,20,70,0</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_COMPOSED</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_composed</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTE_CENTRE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText">OnComposedText</event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</wxFormBuilder_Project>
|
@ -74,7 +74,6 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
@ -82,12 +81,14 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="zrcolaapp.cpp" />
|
||||
<ClCompile Include="zrcolaframe.cpp" />
|
||||
<ClCompile Include="zrcoladlg.cpp" />
|
||||
<ClCompile Include="zrcolagui.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="zrcolaapp.h" />
|
||||
<ClInclude Include="zrcolaframe.h" />
|
||||
<ClInclude Include="zrcoladlg.h" />
|
||||
<ClInclude Include="zrcolagui.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\lib\wxExtend\build\wxExtend.vcxproj">
|
||||
|
@ -18,13 +18,13 @@
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="zrcolaapp.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="zrcolaframe.cpp">
|
||||
<ClCompile Include="zrcolagui.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="zrcoladlg.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
@ -35,7 +35,10 @@
|
||||
<ClInclude Include="zrcolaapp.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="zrcolaframe.h">
|
||||
<ClInclude Include="zrcolagui.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="zrcoladlg.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
|
@ -1,59 +0,0 @@
|
||||
/*
|
||||
Copyright 2015-2016 Amebis
|
||||
|
||||
This file is part of ZRCola.
|
||||
|
||||
ZRCola is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ZRCola is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow)
|
||||
//{
|
||||
// UNREFERENCED_PARAMETER(hInstance);
|
||||
// UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
// UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
// UNREFERENCED_PARAMETER(nCmdShow);
|
||||
//
|
||||
// Sleep(10000);
|
||||
//
|
||||
// {
|
||||
// INPUT input[2];
|
||||
//
|
||||
// input[0].type = INPUT_KEYBOARD;
|
||||
// input[0].ki.wVk = 0;
|
||||
// input[0].ki.wScan = 0x00d2;
|
||||
// input[0].ki.dwFlags = KEYEVENTF_UNICODE;
|
||||
// input[0].ki.time = 0;
|
||||
// input[0].ki.dwExtraInfo = 0;
|
||||
//
|
||||
// input[1].type = INPUT_KEYBOARD;
|
||||
// input[1].ki.wVk = 0;
|
||||
// input[1].ki.wScan = 0x00d2;
|
||||
// input[1].ki.dwFlags = KEYEVENTF_UNICODE | KEYEVENTF_KEYUP;
|
||||
// input[1].ki.time = 0;
|
||||
// input[1].ki.dwExtraInfo = 0;
|
||||
//
|
||||
// SendInput(_countof(input), input, sizeof(INPUT));
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
//}
|
@ -21,11 +21,9 @@
|
||||
|
||||
#include "../include/ZRCola.h"
|
||||
#include "zrcolaapp.h"
|
||||
#include "zrcolaframe.h"
|
||||
#include "zrcoladlg.h"
|
||||
|
||||
#include <wx/font.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wxex/common.h>
|
||||
|
||||
#include <vector>
|
||||
|
@ -35,11 +35,7 @@ bool ZRColaApp::OnInit()
|
||||
if (wxLocale::IsAvailable(wxLANGUAGE_SLOVENIAN))
|
||||
wxVERIFY(m_locale.AddCatalog(wxT("ZRCola")));
|
||||
|
||||
wxZRColaFrame* mainFrame = new wxZRColaFrame();
|
||||
if (!mainFrame->Create()) {
|
||||
delete mainFrame;
|
||||
return false;
|
||||
}
|
||||
wxZRColaDialog* mainFrame = new wxZRColaDialog();
|
||||
|
||||
mainFrame->Show();
|
||||
|
||||
|
@ -21,57 +21,22 @@
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// wxZRColaFrame
|
||||
// wxZRColaDialog
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxBEGIN_EVENT_TABLE(wxZRColaFrame, wxAppBarFrame)
|
||||
EVT_TEXT (wxZRColaFrame::wxID_DECOMPOSED , wxZRColaFrame::OnDecomposedText )
|
||||
EVT_TEXT (wxZRColaFrame::wxID_COMPOSED , wxZRColaFrame::OnComposedText )
|
||||
EVT_UPDATE_UI(wxZRColaFrame::wxID_SEND_COMPOSED, wxZRColaFrame::OnSendComposedUpdate)
|
||||
EVT_MENU (wxZRColaFrame::wxID_SEND_COMPOSED, wxZRColaFrame::OnSendComposed )
|
||||
EVT_MENU (wxZRColaFrame::wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
|
||||
EVT_MENU ( wxID_ABOUT , wxZRColaFrame::OnAbout )
|
||||
wxBEGIN_EVENT_TABLE(wxZRColaDialog, wxZRColaDialogBase)
|
||||
EVT_UPDATE_UI(wxZRColaDialog::wxID_SEND_COMPOSED, wxZRColaDialog::OnSendComposedUpdate)
|
||||
EVT_MENU (wxZRColaDialog::wxID_SEND_COMPOSED, wxZRColaDialog::OnSendComposed )
|
||||
EVT_MENU (wxZRColaDialog::wxID_SEND_ABORT , wxZRColaDialog::OnSendAbort )
|
||||
EVT_MENU ( wxID_ABOUT , wxZRColaDialog::OnAbout )
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
|
||||
wxZRColaFrame::wxZRColaFrame() :
|
||||
wxZRColaDialog::wxZRColaDialog() :
|
||||
m_hWndSource(NULL),
|
||||
wxAppBarFrame()
|
||||
wxZRColaDialogBase(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool wxZRColaFrame::Create()
|
||||
{
|
||||
wxImage::AddHandler(new wxICOHandler);
|
||||
|
||||
wxCHECK(wxAppBarFrame::Create(NULL, wxID_ANY, _("ZRCola"), wxABS_FLOAT, wxABF_ALLOWFLOAT | wxABF_ALLOWDOCKHORIZONTAL | wxABF_ALLOWSIZING | wxABF_HIDETASKBARTABWHENDOCKED, wxDefaultPosition, wxSize(400, 150)), false);
|
||||
|
||||
wxFont fontZRCola(20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("00 ZRCola"));
|
||||
|
||||
wxCHECK(m_decomposed.Create(this, wxID_DECOMPOSED, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE), false);
|
||||
m_decomposed.SetFont(fontZRCola);
|
||||
|
||||
wxCHECK(m_composed.Create(this, wxID_COMPOSED, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE), false);
|
||||
m_composed.SetFont(fontZRCola);
|
||||
|
||||
wxBoxSizer
|
||||
*boxH = new wxBoxSizer(wxHORIZONTAL),
|
||||
*boxV = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
boxV->Add(&m_decomposed, 1, wxEXPAND, 5);
|
||||
boxV->Add(&m_composed, 1, wxEXPAND, 5);
|
||||
boxH->Add(boxV, 1, wxEXPAND, 5);
|
||||
|
||||
m_toolBar.Create(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL);
|
||||
m_toolBar.AddTool(wxID_SEND_COMPOSED, _("Send"), wxBitmap(wxIcon(wxICON(send.ico))));
|
||||
m_toolBar.Realize();
|
||||
|
||||
boxH->Add(&m_toolBar, 0, wxEXPAND, 5);
|
||||
|
||||
SetSizer(boxH);
|
||||
Layout();
|
||||
Centre(wxBOTH);
|
||||
SetIcon(wxIcon(wxICON(send.ico)));
|
||||
|
||||
// Register global hotkey(s).
|
||||
if (!RegisterHotKey(wxZRColaHKID_INVOKE, MOD_ALT | MOD_CONTROL, 'Z'))
|
||||
@ -84,49 +49,51 @@ bool wxZRColaFrame::Create()
|
||||
entries[1].Set(wxACCEL_NORMAL, WXK_ESCAPE, wxID_SEND_ABORT);
|
||||
SetAcceleratorTable(wxAcceleratorTable(_countof(entries), entries));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool wxZRColaFrame::Destroy()
|
||||
wxZRColaDialog::~wxZRColaDialog()
|
||||
{
|
||||
// Unregister global hotkey(s).
|
||||
UnregisterHotKey(wxZRColaHKID_INVOKE);
|
||||
|
||||
return wxAppBarFrame::Destroy();
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaFrame::OnDecomposedText(wxCommandEvent& event)
|
||||
void wxZRColaDialog::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaDialog::OnDecomposedText(wxCommandEvent& event)
|
||||
{
|
||||
// TODO: Do the real ZRCola composition here.
|
||||
m_composed.SetValue(m_decomposed.GetValue());
|
||||
m_composed->SetValue(m_decomposed->GetValue());
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaFrame::OnComposedText(wxCommandEvent& event)
|
||||
void wxZRColaDialog::OnComposedText(wxCommandEvent& event)
|
||||
{
|
||||
// TODO: Do the real ZRCola decomposition here.
|
||||
m_decomposed.SetValue(m_composed.GetValue());
|
||||
m_decomposed->SetValue(m_composed->GetValue());
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaFrame::OnSendComposedUpdate(wxUpdateUIEvent& event)
|
||||
void wxZRColaDialog::OnSendComposedUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
event.Enable(m_hWndSource ? true : false);
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaFrame::OnSendComposed(wxCommandEvent& event)
|
||||
void wxZRColaDialog::OnSendComposed(wxCommandEvent& event)
|
||||
{
|
||||
if (m_hWndSource) {
|
||||
// Get text and its length (in Unicode characters). Prepare the INPUT table.
|
||||
wxString text = m_composed.GetValue();
|
||||
wxString text = m_composed->GetValue();
|
||||
std::vector<INPUT>::size_type i = 0, n = text.length();
|
||||
wxString::const_iterator i_text = text.begin();
|
||||
std::vector<INPUT> input(n);
|
||||
@ -147,15 +114,15 @@ void wxZRColaFrame::OnSendComposed(wxCommandEvent& event)
|
||||
m_hWndSource = NULL;
|
||||
|
||||
// Select all input in composer to prepare for the overwrite next time.
|
||||
m_decomposed.SelectAll();
|
||||
m_composed.SelectAll();
|
||||
m_decomposed->SelectAll();
|
||||
m_composed->SelectAll();
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaFrame::OnSendAbort(wxCommandEvent& event)
|
||||
void wxZRColaDialog::OnSendAbort(wxCommandEvent& event)
|
||||
{
|
||||
if (m_hWndSource) {
|
||||
// Return focus to the source window.
|
||||
@ -164,48 +131,48 @@ void wxZRColaFrame::OnSendAbort(wxCommandEvent& event)
|
||||
m_hWndSource = NULL;
|
||||
|
||||
// Select all input in composer to prepare for the overwrite next time.
|
||||
m_decomposed.SelectAll();
|
||||
m_composed.SelectAll();
|
||||
m_decomposed->SelectAll();
|
||||
m_composed->SelectAll();
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaFrame::OnAbout(wxCommandEvent& event)
|
||||
void wxZRColaDialog::OnAbout(wxCommandEvent& event)
|
||||
{
|
||||
wxMessageBox(wxString::Format(_("ZRCola v%s\nCopyright 2015-%s Amebis"), wxT(ZRCOLA_VERSION_STR), wxT(ZRCOLA_BUILD_YEAR_STR)), _("About ZRCola"), wxOK | wxICON_INFORMATION);
|
||||
}
|
||||
|
||||
|
||||
WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
WXLRESULT wxZRColaDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
if (message == WM_HOTKEY && wParam == wxZRColaHKID_INVOKE) {
|
||||
// ZRCola hotkey was pressed. Remember the source window and focus ours.
|
||||
m_hWndSource = ::GetForegroundWindow();
|
||||
|
||||
m_decomposed.SetFocus();
|
||||
if (m_state == wxABS_FLOAT) {
|
||||
m_decomposed->SetFocus();
|
||||
//if (m_state == wxABS_FLOAT) {
|
||||
if (IsIconized()) {
|
||||
::SendMessage(m_hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
|
||||
} else {
|
||||
::SetActiveWindow(m_hWnd);
|
||||
::SetForegroundWindow(m_hWnd);
|
||||
}
|
||||
} else if (wxAppBarIsDocked(m_state)) {
|
||||
// ZRCola window is currently docked.
|
||||
//} else if (wxAppBarIsDocked(m_state)) {
|
||||
// // ZRCola window is currently docked.
|
||||
|
||||
if (GetAutoHidden()) {
|
||||
// Unhide it.
|
||||
ShowAutoHideAppBar();
|
||||
}
|
||||
// if (GetAutoHidden()) {
|
||||
// // Unhide it.
|
||||
// ShowAutoHideAppBar();
|
||||
// }
|
||||
|
||||
::SetActiveWindow(m_hWnd);
|
||||
::SetForegroundWindow(m_hWnd);
|
||||
} else
|
||||
wxFAIL_MSG(wxT("unsupported application bar state"));
|
||||
// ::SetActiveWindow(m_hWnd);
|
||||
// ::SetForegroundWindow(m_hWnd);
|
||||
//} else
|
||||
// wxFAIL_MSG(wxT("unsupported application bar state"));
|
||||
|
||||
return 0;
|
||||
} else
|
||||
return wxAppBarFrame::MSWWindowProc(message, wParam, lParam);
|
||||
return wxZRColaDialogBase::MSWWindowProc(message, wParam, lParam);
|
||||
}
|
@ -19,10 +19,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wxex/appbar.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/toolbar.h>
|
||||
|
||||
#include "zrcolagui.h"
|
||||
|
||||
///
|
||||
/// Global hotkey message identifiers
|
||||
@ -33,24 +30,23 @@
|
||||
///
|
||||
/// ZRCola main frame
|
||||
///
|
||||
class wxZRColaFrame : public wxAppBarFrame
|
||||
class wxZRColaDialog : public wxZRColaDialogBase
|
||||
{
|
||||
protected:
|
||||
enum {
|
||||
wxID_SEND_COMPOSED = wxID_HIGHEST,
|
||||
wxID_SEND_ABORT,
|
||||
wxID_DECOMPOSED,
|
||||
wxID_COMPOSED,
|
||||
};
|
||||
|
||||
public:
|
||||
wxZRColaFrame();
|
||||
bool Create();
|
||||
virtual bool Destroy();
|
||||
wxZRColaDialog();
|
||||
virtual ~wxZRColaDialog();
|
||||
|
||||
protected:
|
||||
void OnDecomposedText(wxCommandEvent& event);
|
||||
void OnComposedText(wxCommandEvent& event);
|
||||
virtual void OnClose(wxCloseEvent& event);
|
||||
virtual void OnDecomposedText(wxCommandEvent& event);
|
||||
virtual void OnComposedText(wxCommandEvent& event);
|
||||
|
||||
void OnSendComposedUpdate(wxUpdateUIEvent& event);
|
||||
void OnSendComposed(wxCommandEvent& event);
|
||||
void OnSendAbort(wxCommandEvent& event);
|
||||
@ -61,9 +57,5 @@ protected:
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
protected:
|
||||
wxTextCtrl m_decomposed; ///< ZRCola decomposed text window
|
||||
wxTextCtrl m_composed; ///< ZRCola composed text window
|
||||
wxToolBar m_toolBar; ///< The toolbar
|
||||
|
||||
WXHWND m_hWndSource; ///< handle of the active window, when the ZRCola hotkey was pressed
|
||||
};
|
62
ZRCola/zrcolagui.cpp
Normal file
62
ZRCola/zrcolagui.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "zrcolagui.h"
|
||||
|
||||
// Using the construction of a static object to ensure that the help provider is set
|
||||
class wxFBContextSensitiveHelpSetter
|
||||
{
|
||||
public:
|
||||
wxFBContextSensitiveHelpSetter()
|
||||
{
|
||||
wxHelpProvider::Set( new wxHelpControllerHelpProvider );
|
||||
}
|
||||
};
|
||||
|
||||
static wxFBContextSensitiveHelpSetter s_wxFBSetTheHelpProvider;
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxZRColaDialogBase::wxZRColaDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bSizerEditor;
|
||||
bSizerEditor = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
bSizerEditor->SetMinSize( wxSize( 100,100 ) );
|
||||
m_decomposed = new wxTextCtrl( this, wxID_DECOMPOSED, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE );
|
||||
m_decomposed->SetFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
|
||||
|
||||
bSizerEditor->Add( m_decomposed, 50, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_composed = new wxTextCtrl( this, wxID_COMPOSED, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE );
|
||||
m_composed->SetFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
|
||||
|
||||
bSizerEditor->Add( m_composed, 50, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizerEditor );
|
||||
this->Layout();
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaDialogBase::OnClose ) );
|
||||
m_decomposed->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaDialogBase::OnDecomposedText ), NULL, this );
|
||||
m_composed->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaDialogBase::OnComposedText ), NULL, this );
|
||||
}
|
||||
|
||||
wxZRColaDialogBase::~wxZRColaDialogBase()
|
||||
{
|
||||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaDialogBase::OnClose ) );
|
||||
m_decomposed->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaDialogBase::OnDecomposedText ), NULL, this );
|
||||
m_composed->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaDialogBase::OnComposedText ), NULL, this );
|
||||
|
||||
}
|
56
ZRCola/zrcolagui.h
Normal file
56
ZRCola/zrcolagui.h
Normal file
@ -0,0 +1,56 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ZRCOLAGUI_H__
|
||||
#define __ZRCOLAGUI_H__
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/cshelp.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class wxZRColaDialogBase
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class wxZRColaDialogBase : public wxDialog
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
wxID_DECOMPOSED = 1000,
|
||||
wxID_COMPOSED
|
||||
};
|
||||
|
||||
wxTextCtrl* m_decomposed;
|
||||
wxTextCtrl* m_composed;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
|
||||
virtual void OnDecomposedText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnComposedText( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
wxZRColaDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("ZRCola"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,200 ), long style = wxCAPTION|wxCLOSE_BOX|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
|
||||
~wxZRColaDialogBase();
|
||||
|
||||
};
|
||||
|
||||
#endif //__ZRCOLAGUI_H__
|
Loading…
x
Reference in New Issue
Block a user