/* 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: WxdkdrawDlgMiterLimit.wxc */ /** @file WxdkdrawDlgMiterLimit.cpp The WxdkdrawDlgMiterLimit module. */ #line 150 "WxdkdrawDlgMiterLimit.wxc" #ifndef WXDKDRAWDLGMITERLIMIT_H_INCLUDED #include "WxdkdrawDlgMiterLimit.h" #endif #line 158 "WxdkdrawDlgMiterLimit.wxc" #if wxCHECK_VERSION(3,0,0) wxBEGIN_EVENT_TABLE(WxdkdrawDlgMiterLimit,wxDialog) #else BEGIN_EVENT_TABLE(WxdkdrawDlgMiterLimit,wxDialog) #endif EVT_BUTTON(\ wxID_OK,\ WxdkdrawDlgMiterLimit::OnOK\ ) EVT_BUTTON(\ wxID_CANCEL,\ WxdkdrawDlgMiterLimit::OnCancel\ ) EVT_SPINCTRL(\ WxdkdrawDlgMiterLimit::WXD_ID_SL_ML,\ WxdkdrawDlgMiterLimit::OnSpin\ ) #if wxCHECK_VERSION(3,0,0) wxEND_EVENT_TABLE() #else END_EVENT_TABLE() #endif #line 186 "WxdkdrawDlgMiterLimit.wxc" WxdkdrawDlgMiterLimit::WxdkdrawDlgMiterLimit( WxdkdrawFrame *pParent, Wxd_object_t *pObject, wxChar const * const *pTexts, bool bDrwElem ) : wxDialog( pParent, wxID_ANY, pTexts[238], wxDefaultPosition, wxDefaultSize, ( (wxDEFAULT_DIALOG_STYLE) & (~(wxRESIZE_BORDER)) & (~(wxCLOSE_BOX)) & (~(wxSYSTEM_MENU)) ) ) { m_pParent = pParent; m_pObject = pObject; m_bDrwElem = bDrwElem; m_uLimitOriginal = pObject->ml; m_uLimitCurrent = m_uLimitOriginal; dkctGUILayoutOK = false; sizerHorizontal = NULL; sizerVertical = NULL; sizerInput = NULL; sizerButtons = NULL; labelValue = NULL; spinValue = 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; } labelValue = new wxStaticText( this, wxID_ANY, pTexts[239] ); if(!(labelValue)) { goto dkctGUILayoutFinished; } sizerInput->Add( labelValue, 0, wxALIGN_CENTER_VERTICAL ); sizerInput->Add(10, 10, 0); spinValue = new wxSpinCtrl( this, WXD_ID_SL_ML, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 1, 255, 8 ); if(!(spinValue)) { goto dkctGUILayoutFinished; } spinValue->SetToolTip(pTexts[240]); sizerInput->Add( spinValue, 0, wxALIGN_CENTER_VERTICAL ); sizerVertical->Add( sizerInput, 0, wxALIGN_CENTER_HORIZONTAL ); sizerVertical->Add(10, 10, 0); sizerButtons = new wxStdDialogButtonSizer( ); if(!(sizerButtons)) { goto dkctGUILayoutFinished; } buttonOK = new wxButton( this, wxID_OK, pTexts[241] ); if(!(buttonOK)) { goto dkctGUILayoutFinished; } buttonOK->SetToolTip(pTexts[242]); sizerButtons->AddButton( buttonOK ); buttonCancel = new wxButton( this, wxID_CANCEL, pTexts[243] ); if(!(buttonCancel)) { goto dkctGUILayoutFinished; } buttonCancel->SetToolTip(pTexts[244]); sizerButtons->AddButton( buttonCancel ); sizerButtons->Realize(); sizerVertical->Add( sizerButtons, 0, wxALIGN_CENTER_HORIZONTAL ); 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 208 "WxdkdrawDlgMiterLimit.wxc" if (dkctGUILayoutOK) { wxSize minsize = GetMinSize(); SetMaxSize(minsize); spinValue->SetValue(m_uLimitCurrent); } } #line 217 "WxdkdrawDlgMiterLimit.wxc" void WxdkdrawDlgMiterLimit::OnOK(wxCommandEvent & WXUNUSED(event)) { bool bDoRefresh = false; m_uLimitCurrent = spinValue->GetValue(); if ((m_bDrwElem) && (m_uLimitCurrent != m_pObject->ml)) { bDoRefresh = true; } m_pObject->ml = m_uLimitCurrent; if (bDoRefresh) { m_pParent->RequireRedraw(WXD_REFRESH_DRAWING); } if(IsModal()) { EndModal(wxID_OK); } else { SetReturnCode(wxID_OK); Show(false); } } void WxdkdrawDlgMiterLimit::OnCancel(wxCommandEvent & WXUNUSED(event)) { bool bDoRefresh = false; m_uLimitCurrent = m_uLimitOriginal; if ((m_bDrwElem) && (m_pObject->ml != m_uLimitCurrent)) { bDoRefresh = true; } m_pObject->ml = m_uLimitCurrent; if (bDoRefresh) { m_pParent->RequireRedraw(WXD_REFRESH_DRAWING); } if(IsModal()) { EndModal(wxID_CANCEL); } else { SetReturnCode(wxID_CANCEL); Show(false); } } void WxdkdrawDlgMiterLimit::OnSpin(wxSpinEvent & WXUNUSED(event)) { bool bDoRefresh = false; #line 271 "WxdkdrawDlgMiterLimit.wxc" m_uLimitCurrent = spinValue->GetValue(); if ((m_bDrwElem) && (m_uLimitCurrent != m_pObject->ml)) { bDoRefresh = true; } m_pObject->ml = m_uLimitCurrent; if (bDoRefresh) { m_pParent->RequireRedraw(WXD_REFRESH_DRAWING); } #line 280 "WxdkdrawDlgMiterLimit.wxc" } /* vim: set ai sw=4 ts=4 : */