/* Copyright (C) 2019-2020, Dirk Krause SPDX-License-Identifier: BSD-3-Clause */ /* WARNING: This file was generated by the dkct program (see http://dktools.sourceforge.net/ for details). Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: WxdkdrawDlgStyleLength.wxc */ /** @file WxdkdrawDlgStyleLength.cpp The WxdkdrawDlgStyleLength module. */ #line 150 "WxdkdrawDlgStyleLength.wxc" #ifndef WXDKDRAWDLGSTYLELENGTH_H_INCLUDED #include "WxdkdrawDlgStyleLength.h" #endif #line 158 "WxdkdrawDlgStyleLength.wxc" /** Assign function calls to events. */ #if wxCHECK_VERSION(3,0,0) wxBEGIN_EVENT_TABLE(WxdkdrawDlgStyleLength,wxDialog) #else BEGIN_EVENT_TABLE(WxdkdrawDlgStyleLength,wxDialog) #endif EVT_BUTTON(\ wxID_OK,\ WxdkdrawDlgStyleLength::OnOK\ ) EVT_BUTTON(\ wxID_CANCEL,\ WxdkdrawDlgStyleLength::OnCancel\ ) EVT_SPINCTRL(\ WxdkdrawDlgStyleLength::WXD_ID_SL_LENGTH,\ WxdkdrawDlgStyleLength::OnSpin\ ) #if wxCHECK_VERSION(3,0,0) wxEND_EVENT_TABLE() #else END_EVENT_TABLE() #endif #line 188 "WxdkdrawDlgStyleLength.wxc" WxdkdrawDlgStyleLength::WxdkdrawDlgStyleLength( WxdkdrawFrame *pParent, Wxd_object_t *pObject, bool bDrwElem, wxChar const * const *pText ) : wxDialog( pParent, wxID_ANY, pText[225], wxDefaultPosition, wxDefaultSize, ( (wxDEFAULT_DIALOG_STYLE) & (~(wxRESIZE_BORDER)) & (~(wxCLOSE_BOX)) & (~(wxSYSTEM_MENU)) ) ) { #line 206 "WxdkdrawDlgStyleLength.wxc" m_pParent = pParent; m_pObject = pObject; m_bDrwElem = bDrwElem; m_uLengthOriginal = pObject->sl; m_uLengthCurrent = m_uLengthOriginal; dkctGUILayoutOK = false; sizerHorizontal = NULL; sizerVertical = NULL; sizerInput = NULL; sizerButtons = NULL; labelStyleLength = NULL; spinStyleLength = NULL; buttonOK = NULL; buttonCancel = NULL; sizerHorizontal = new wxBoxSizer( wxHORIZONTAL ); if(!(sizerHorizontal)) { goto dkctGUILayoutFinished; } sizerHorizontal->Add(10, 10, 0); sizerVertical = new wxBoxSizer( wxVERTICAL ); if(!(sizerVertical)) { goto dkctGUILayoutFinished; } sizerVertical->Add(10, 10, 0); sizerInput = new wxBoxSizer( wxHORIZONTAL ); if(!(sizerInput)) { goto dkctGUILayoutFinished; } labelStyleLength = new wxStaticText( this, wxID_ANY, pText[226] ); if(!(labelStyleLength)) { goto dkctGUILayoutFinished; } sizerInput->Add( labelStyleLength ); sizerInput->Add(10, 10, 0); spinStyleLength = new wxSpinCtrl( this, WXD_ID_SL_LENGTH, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 1, 255, 4 ); if(!(spinStyleLength)) { goto dkctGUILayoutFinished; } spinStyleLength->SetToolTip(pText[227]); sizerInput->Add( spinStyleLength ); sizerVertical->Add( sizerInput ); sizerVertical->Add(10, 10, 0); sizerButtons = new wxStdDialogButtonSizer( ); if(!(sizerButtons)) { goto dkctGUILayoutFinished; } buttonOK = new wxButton( this, wxID_OK, pText[228] ); if(!(buttonOK)) { goto dkctGUILayoutFinished; } buttonOK->SetToolTip(pText[229]); sizerButtons->AddButton( buttonOK ); buttonCancel = new wxButton( this, wxID_CANCEL, pText[230] ); if(!(buttonCancel)) { goto dkctGUILayoutFinished; } buttonCancel->SetToolTip(pText[231]); sizerButtons->AddButton( buttonCancel ); sizerButtons->Realize(); sizerVertical->Add( sizerButtons ); sizerVertical->Add(10, 10, 0); sizerHorizontal->Add( sizerVertical ); sizerHorizontal->Add(10, 10, 0); SetSizer(sizerHorizontal); dkctGUILayoutOK = true; dkctGUILayoutFinished: if(dkctGUILayoutOK) { sizerHorizontal->Fit(this); sizerHorizontal->SetSizeHints(this); } #line 214 "WxdkdrawDlgStyleLength.wxc" if (dkctGUILayoutOK) { wxSize minsize = GetMinSize(); SetMaxSize(minsize); } #line 220 "WxdkdrawDlgStyleLength.wxc" } #line 225 "WxdkdrawDlgStyleLength.wxc" void WxdkdrawDlgStyleLength::OnOK(wxCommandEvent & WXUNUSED(event)) { bool bDoRefresh = false; #line 233 "WxdkdrawDlgStyleLength.wxc" m_uLengthCurrent = spinStyleLength->GetValue(); if ((m_bDrwElem) && (m_uLengthCurrent != m_pObject->sl)) { bDoRefresh = true; } m_pObject->sl = m_uLengthCurrent; if (bDoRefresh) { m_pParent->RequireRedraw(WXD_REFRESH_DRAWING); } if(IsModal()) { EndModal(wxID_OK); } else { SetReturnCode(wxID_OK); Show(false); } #line 250 "WxdkdrawDlgStyleLength.wxc" } void WxdkdrawDlgStyleLength::OnCancel(wxCommandEvent & WXUNUSED(event)) { bool bDoRefresh = false; #line 259 "WxdkdrawDlgStyleLength.wxc" m_uLengthCurrent = m_uLengthOriginal; if ((m_bDrwElem) && (m_uLengthCurrent != m_pObject->sl)) { bDoRefresh = true; } m_pObject->sl = m_uLengthCurrent; if (bDoRefresh) { m_pParent->RequireRedraw(WXD_REFRESH_DRAWING); } if(IsModal()) { EndModal(wxID_CANCEL); } else { SetReturnCode(wxID_CANCEL); Show(false); } #line 275 "WxdkdrawDlgStyleLength.wxc" } void WxdkdrawDlgStyleLength::OnSpin(wxSpinEvent & WXUNUSED(event)) { bool bDoRefresh = false; #line 284 "WxdkdrawDlgStyleLength.wxc" m_uLengthCurrent = spinStyleLength->GetValue(); if ((m_bDrwElem) && (m_pObject->sl != m_uLengthCurrent)) { bDoRefresh = true; } m_pObject->sl = m_uLengthCurrent; if (bDoRefresh) { m_pParent->RequireRedraw(WXD_REFRESH_DRAWING); } #line 293 "WxdkdrawDlgStyleLength.wxc" } /* vim: set ai sw=4 ts=4 : */