/* 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: WxdkdrawDlgLineJoin.wxc */ /** @file WxdkdrawDlgLineJoin.cpp The WxdkdrawDlgLineJoin module. */ #line 159 "WxdkdrawDlgLineJoin.wxc" #ifndef WXDKDRAWDLGLINEJOIN_H_INCLUDED #include "WxdkdrawDlgLineJoin.h" #endif #line 167 "WxdkdrawDlgLineJoin.wxc" #if wxCHECK_VERSION(3,0,0) wxBEGIN_EVENT_TABLE(WxdkdrawDlgLineJoin,wxDialog) #else BEGIN_EVENT_TABLE(WxdkdrawDlgLineJoin,wxDialog) #endif EVT_BUTTON(\ WxdkdrawDlgLineJoin::WXD_ID_LJ_MITERED,\ WxdkdrawDlgLineJoin::OnJoinButton\ ) EVT_BUTTON(\ WxdkdrawDlgLineJoin::WXD_ID_LJ_ROUNDED,\ WxdkdrawDlgLineJoin::OnJoinButton\ ) EVT_BUTTON(\ WxdkdrawDlgLineJoin::WXD_ID_LJ_BEVELED,\ WxdkdrawDlgLineJoin::OnJoinButton\ ) EVT_BUTTON(\ wxID_CANCEL,\ WxdkdrawDlgLineJoin::OnCancel\ ) #if wxCHECK_VERSION(3,0,0) wxEND_EVENT_TABLE() #else END_EVENT_TABLE() #endif #line 200 "WxdkdrawDlgLineJoin.wxc" WxdkdrawDlgLineJoin::WxdkdrawDlgLineJoin( WxdkdrawFrame *pParent, Wxd_object_t *pObject, wxChar const * const *pTexts, const char ** const *pImages, bool bDrwElem ) : wxDialog( pParent, wxID_ANY, pTexts[232], wxDefaultPosition, wxDefaultSize, ( (wxDEFAULT_DIALOG_STYLE) & (~(wxRESIZE_BORDER)) & (~(wxCLOSE_BOX)) & (~(wxSYSTEM_MENU)) ) ) { m_pParent = pParent; m_pObject = pObject; m_pTexts = pTexts; m_pImages = pImages; m_bDrwElem = bDrwElem; m_uLineJoinOriginal = pObject->js; if (WXD_LJ_BEVELED < m_uLineJoinOriginal) { m_uLineJoinOriginal = WXD_LJ_BEVELED; } m_uLineJoinCurrent = m_uLineJoinOriginal; dkctGUILayoutOK = false; sizerHorizontal = NULL; sizerVertical = NULL; sizerButtons = NULL; buttonCancel = NULL; buttonMitered = NULL; buttonRounded = NULL; buttonBeveled = 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); sizerButtons = new wxBoxSizer( wxHORIZONTAL ); if(!(sizerButtons)) { goto dkctGUILayoutFinished; } buttonMitered = new wxBitmapButton( this, WXD_ID_LJ_MITERED, pImages[0] ); if(!(buttonMitered)) { goto dkctGUILayoutFinished; } buttonMitered->SetToolTip(pTexts[233]); sizerButtons->Add( buttonMitered, 0, wxALIGN_CENTER_VERTICAL ); sizerButtons->Add(10, 10, 0); buttonRounded = new wxBitmapButton( this, WXD_ID_LJ_ROUNDED, pImages[1] ); if(!(buttonRounded)) { goto dkctGUILayoutFinished; } buttonRounded->SetToolTip(pTexts[234]); sizerButtons->Add( buttonRounded, 0, wxALIGN_CENTER_VERTICAL ); sizerButtons->Add(10, 10, 0); buttonBeveled = new wxBitmapButton( this, WXD_ID_LJ_BEVELED, pImages[2] ); if(!(buttonBeveled)) { goto dkctGUILayoutFinished; } buttonBeveled->SetToolTip(pTexts[235]); sizerButtons->Add( buttonBeveled, 0, wxALIGN_CENTER_VERTICAL ); sizerVertical->Add( sizerButtons ); sizerVertical->Add(10, 10, 0); buttonCancel = new wxButton( this, wxID_CANCEL, pTexts[236] ); if(!(buttonCancel)) { goto dkctGUILayoutFinished; } buttonCancel->SetToolTip(pTexts[237]); sizerVertical->Add( buttonCancel, 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 228 "WxdkdrawDlgLineJoin.wxc" if (dkctGUILayoutOK) { wxSize minsize = GetMinSize(); SetMaxSize(minsize); } } #line 237 "WxdkdrawDlgLineJoin.wxc" void WxdkdrawDlgLineJoin::OnJoinButton(wxCommandEvent & event) { bool bDoRefresh = false; switch (event.GetId()) { case WXD_ID_LJ_ROUNDED : { m_uLineJoinCurrent = WXD_LJ_ROUNDED; } break; case WXD_ID_LJ_BEVELED : { m_uLineJoinCurrent = WXD_LJ_BEVELED; } break; default : { m_uLineJoinCurrent = WXD_LJ_MITERED; } break; } if ((m_bDrwElem) && (m_uLineJoinCurrent != m_pObject->js)) { bDoRefresh = true; } m_pObject->js = m_uLineJoinCurrent; if (bDoRefresh) { m_pParent->RequireRedraw(WXD_REFRESH_DRAWING); } if(IsModal()) { EndModal(wxID_OK); } else { SetReturnCode(wxID_OK); Show(false); } } void WxdkdrawDlgLineJoin::OnCancel(wxCommandEvent & WXUNUSED(event)) { if(IsModal()) { EndModal(wxID_CANCEL); } else { SetReturnCode(wxID_CANCEL); Show(false); } } /* vim: set ai sw=4 ts=4 : */