summaryrefslogtreecommitdiff
path: root/support/dktools/DkWxTraceOptionsDialog.wxc
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-10-12 03:04:00 +0000
committerNorbert Preining <norbert@preining.info>2020-10-12 03:04:00 +0000
commit0ce40abb18ec02ec6fd6bcc5f21612c88daa7578 (patch)
tree416289fe1448873fd8ca33051f50ad85bffa8aaa /support/dktools/DkWxTraceOptionsDialog.wxc
parentfdb18507cd80dc17f5a5256153d34668b4f4e61c (diff)
CTAN sync 202010120303
Diffstat (limited to 'support/dktools/DkWxTraceOptionsDialog.wxc')
-rw-r--r--support/dktools/DkWxTraceOptionsDialog.wxc432
1 files changed, 0 insertions, 432 deletions
diff --git a/support/dktools/DkWxTraceOptionsDialog.wxc b/support/dktools/DkWxTraceOptionsDialog.wxc
deleted file mode 100644
index a79fdfc16d..0000000000
--- a/support/dktools/DkWxTraceOptionsDialog.wxc
+++ /dev/null
@@ -1,432 +0,0 @@
-%% options
-
-copyright owner = Dirk Krause
-copyright year = 2011-xxxx
-SPDX-License-Identifier: BSD-3-Clause
-
-
-%% wx-gui
-
-type = dialog
-contents = sDialog
-
-[wxBoxSizer sDialog]
-direction = horizontal
-contents = $stretch(10)
-contents = verticalSizer
-contents = $stretch(10)
-
-[wxBoxSizer verticalSizer]
-direction = vertical
-grow = yes
-contents = $stretch(10)
-contents = sSetup centered-x
-contents = $stretch(10)
-contents = sButtons centered-x
-contents = $stretch(10)
-
-[wxGridBagSizer sSetup]
-contents = sttGeneral 0 0 1 4 left
-contents = cbMake +1 0 1 4 left
-contents = $space(1,10) +1 0 1 4 left
-contents = sttOutput +1 0 1 4 left
-contents = cbLinenumbers +1 0 1 4 left
-contents = cbUseSplint +1 0 1 2 left centered-y
-contents = chSplintChar . 2 1 1 left centered-y
-contents = $space(1,10) +1 0 1 4 left
-contents = sttDebug +1 0 1 4 left
-contents = cbDebug +1 0 1 4 left
-contents = $space(20,1) +1 0 1 1 left
-contents = cbDebStdout . 1 1 3 left
-contents = cbDebTime +1 1 1 3 left
-contents = cbDebTraceKw +1 1 1 3 left
-contents = cbDebWide +1 1 1 3 left
-contents = cbDebPortable +1 1 1 3 left
-
-[wxStaticText sttGeneral]
-text = sTexts[33]
-
-[wxCheckBox cbMake]
-text = sTexts[31]
-tip = sTexts[32]
-
-[wxStaticText sttOutput]
-text = sTexts[34]
-
-[wxCheckBox cbLinenumbers]
-text = sTexts[35]
-tip = sTexts[42]
-
-[wxCheckBox cbUseSplint]
-text = sTexts[94]
-tip = sTexts[95]
-id = DkWxTrace_UseSplint
-
-[wxChoice chSplintChar]
-choices = 18 splintCommentChars
-tip = sTexts[96]
-id = DkWxTrace_SplintChar
-
-[wxStaticText sttDebug]
-text = sTexts[36]
-
-[wxCheckBox cbDebug]
-text = sTexts[37]
-tip = sTexts[43]
-id = DkWxTrace_Debug
-
-[wxCheckBox cbDebStdout]
-text = sTexts[38]
-tip = sTexts[44]
-
-[wxCheckBox cbDebTime]
-text = sTexts[39]
-tip = sTexts[45]
-
-[wxCheckBox cbDebTraceKw]
-text = sTexts[40]
-tip = sTexts[46]
-
-[wxCheckBox cbDebWide]
-text = sTexts[41]
-tip = sTexts[48]
-
-[wxCheckBox cbDebPortable]
-text = sTexts[97]
-tip = sTexts[98]
-
-[wxStdDialogButtonSizer sButtons]
-contents = bOK
-contents = bCancel
-
-[wxButton bOK]
-id = wxID_OK
-text = sTexts[26]
-tip = sTexts[28]
-
-[wxButton bCancel]
-id = wxID_CANCEL
-text = sTexts[27]
-tip = sTexts[29]
-
-%% header start
-
-%% class start
-/** Trace options dialog.
-*/
-class DkWxTraceOptionsDialog : public wxDialog
-{
- private:
-
- /** Event table.
- */
-#if wxCHECK_VERSION(3,0,0)
- wxDECLARE_EVENT_TABLE();
-#else
- DECLARE_EVENT_TABLE()
-#endif
-
- protected:
-
- /** Color for section heads.
- */
- wxColour cRed;
-
- /** Parent window.
- */
- DkWxTraceFrame *pa;
-
- /** Message texts.
- */
- wxChar const * const *sTexts;
-
- /** Option set to configure.
- */
- DKCT_OPTION_SET *options;
-
- /** Flag: We are in correction routine.
- */
- int is_correcting;
-
-%% class end
- public:
-
- /** Constructor.
- @param parent Parent window.
- @param title Title text.
- @param messageTexts Localized message texts.
- @param o Options set to modify using this dialog.
- */
- DkWxTraceOptionsDialog(
- DkWxTraceFrame *parent,
- wxChar const *title,
- wxChar const * const *messageTexts,
- DKCT_OPTION_SET *o
- );
-
- protected:
-
- /** Handler for OK button.
- @param event Event to process.
- */
- void OnOK(wxCommandEvent& event);
-
- /** Handler for Cancel button.
- @param event Event to process.
- */
- void OnCancel(wxCommandEvent& event);
-
- /** Handler for clicking the debug checkbox.
- @param event Event to process.
- */
- void OnChangeDebug(wxCommandEvent & event);
-
- /** Handler for changing the use splint option.
- @param event Event to process.
- */
- void OnChangeUseSplint(wxCommandEvent & event);
-
- public:
-
- /** Transfer data from GUI controls to configuration structure.
- */
- void dataOut();
-
- /** Transfer data from configuration structure to GUI controls.
- */
- void dataIn();
-
- /** Correct GUI depending on cbDebug.
- */
- void correctGUI();
-};
-
-%% header end
-
-%% module start
-
-#include "dk3conf.h"
-#include "dkwxtrace.h"
-
-
-
-$!trace-include
-
-
-#if wxCHECK_VERSION(3,0,0)
-wxBEGIN_EVENT_TABLE(DkWxTraceOptionsDialog,wxDialog)
-#else
-BEGIN_EVENT_TABLE(DkWxTraceOptionsDialog,wxDialog)
-#endif
- EVT_BUTTON(wxID_OK, DkWxTraceOptionsDialog::OnOK)
- EVT_BUTTON(wxID_CANCEL, DkWxTraceOptionsDialog::OnCancel)
- EVT_CHECKBOX(DkWxTrace_Debug, DkWxTraceOptionsDialog::OnChangeDebug)
- EVT_CHECKBOX(DkWxTrace_UseSplint, DkWxTraceOptionsDialog::OnChangeUseSplint)
-#if wxCHECK_VERSION(3,0,0)
-wxEND_EVENT_TABLE()
-#else
-END_EVENT_TABLE()
-#endif
-
-%% constructor start
-DkWxTraceOptionsDialog::DkWxTraceOptionsDialog(
- DkWxTraceFrame *parent,
- wxChar const *title,
- wxChar const * const *messageTexts,
- DKCT_OPTION_SET *o
-) : wxDialog(
- parent,
- wxID_ANY,
- title,
- wxDefaultPosition,
- wxDefaultSize,
- wxDEFAULT_DIALOG_STYLE
-),
-cRed(0x7F, 0x00, 0x00)
-{
- wxString splintCommentChars[] = {
- wxString(messageTexts[76]),
- wxString(messageTexts[77]),
- wxString(messageTexts[78]),
- wxString(messageTexts[79]),
- wxString(messageTexts[80]),
- wxString(messageTexts[81]),
- wxString(messageTexts[82]),
- wxString(messageTexts[83]),
- wxString(messageTexts[84]),
- wxString(messageTexts[85]),
- wxString(messageTexts[86]),
- wxString(messageTexts[87]),
- wxString(messageTexts[88]),
- wxString(messageTexts[89]),
- wxString(messageTexts[90]),
- wxString(messageTexts[91]),
- wxString(messageTexts[92]),
- wxString(messageTexts[93]),
- };
- pa = parent;
- sTexts = messageTexts;
- options = o;
- is_correcting = 0;
-%% constructor end
- if (dkctGUILayoutOK) {
- sttGeneral->SetForegroundColour(cRed);
- sttOutput->SetForegroundColour(cRed);
- sttDebug->SetForegroundColour(cRed);
- }
-}
-
-%% module end
-
-void
-DkWxTraceOptionsDialog::OnOK(
- wxCommandEvent & WXUNUSED(event)
-)
-{
- dataOut();
- if(IsModal()) {
- EndModal(wxID_OK);
- } else {
- SetReturnCode(wxID_OK);
- Show(false);
- }
-}
-
-
-void
-DkWxTraceOptionsDialog::OnCancel(
- wxCommandEvent & WXUNUSED(event)
-)
-{
- if(IsModal()) {
- EndModal(wxID_CANCEL);
- } else {
- SetReturnCode(wxID_CANCEL);
- Show(false);
- }
-}
-
-
-
-void
-DkWxTraceOptionsDialog::OnChangeDebug(
- wxCommandEvent & WXUNUSED(event)
-)
-{
- correctGUI();
-}
-
-
-
-void
-DkWxTraceOptionsDialog::OnChangeUseSplint(
- wxCommandEvent & WXUNUSED(event)
-)
-{
- correctGUI();
-}
-
-
-void
-DkWxTraceOptionsDialog::dataIn()
-{
- cbLinenumbers->SetValue((options->lnn) ? true : false);
- cbMake->SetValue((options->mak) ? true : false);
- cbDebug->SetValue((options->deb) ? true : false);
- cbDebStdout->SetValue((options->deb == 2) ? true : false);
- cbDebWide->SetValue((options->win) ? true : false);
- cbDebPortable->SetValue((options->port) ? true : false);
- cbDebTraceKw->SetValue((options->tkw) ? true : false);
- cbDebTime->SetValue((options->ts) ? true : false);
- if ('\0' != options->spls) {
- cbUseSplint->SetValue(true);
- chSplintChar->SetSelection(pa->findSplintCharacterIndex(options->spls));
- } else {
- cbUseSplint->SetValue(false);
- chSplintChar->SetSelection(0);
- }
- correctGUI();
-}
-
-
-
-void
-DkWxTraceOptionsDialog::dataOut()
-{
- options->deb = (cbDebug->GetValue()) ? (
- (cbDebStdout->GetValue()) ? 2 : 1
- ) : 0;
- options->lnn = (cbLinenumbers->GetValue()) ? 1 : 0;
- options->mak = (cbMake->GetValue()) ? 1 : 0;
- options->tkw = (cbDebTraceKw->GetValue()) ? 1 : 0;
- options->ts = (cbDebTime->GetValue()) ? 1 : 0;
- options->win = (cbDebWide->GetValue()) ? 1 : 0;
- options->port = (cbDebPortable->GetValue()) ? 1 : 0;
- if (cbUseSplint->GetValue()) {
- options->spls =
- (char)((sTexts[76 + chSplintChar->GetCurrentSelection()])[0]);
- } else {
- options->spls = '\0';
- }
-}
-
-
-void
-DkWxTraceOptionsDialog::correctGUI()
-{
- if(!(is_correcting)) {
- is_correcting = 1;
- if(cbDebug) {
- if(cbDebug->GetValue()) {
- if(cbDebStdout) {
- cbDebStdout->Enable(true);
- }
- if(cbDebTime) {
- cbDebTime->Enable(true);
- }
- if(cbDebTraceKw) {
- cbDebTraceKw->Enable(true);
- }
- if(cbDebWide) {
- cbDebWide->Enable(true);
- }
- if(NULL != cbDebPortable) {
- cbDebPortable->Enable(true);
- }
- } else {
- if(cbDebStdout) {
- cbDebStdout->SetValue(false);
- cbDebStdout->Enable(false);
- }
- if(cbDebTime) {
- cbDebTime->SetValue(false);
- cbDebTime->Enable(false);
- }
- if(cbDebTraceKw) {
- cbDebTraceKw->SetValue(false);
- cbDebTraceKw->Enable(false);
- }
- if(cbDebWide) {
- cbDebWide->SetValue(false);
- cbDebWide->Enable(false);
- }
- if(NULL != cbDebPortable) {
- cbDebPortable->SetValue(false);
- cbDebPortable->Enable(false);
- }
- }
- }
- if (cbUseSplint) {
- if (cbUseSplint->GetValue()) { $? ". enable"
- chSplintChar->Enable(true);
- } else { $? ". disable"
- chSplintChar->Enable(false);
- }
- }
- is_correcting = 0;
- Refresh();
- Update();
- }
-}
-
-