Macro Editor Fonts

* Added user configuration item for macro editor text
    font and font size
  * Added code to make font change immediate if editor dialog
    is open
pull/1/head
David Freese 2015-03-19 19:23:30 -05:00
rodzic 35ef2ed3fe
commit e48c2fe5da
6 zmienionych plików z 141 dodań i 39 usunięć

Wyświetl plik

@ -25,6 +25,7 @@
#include "status.h"
#include "rx_extract.h"
#include "kmlserver.h"
#include "macroedit.h"
extern void WefaxDestDirSet(Fl_File_Chooser *w, void *userdata);
#if USE_HAMLIB
#include "hamlib.h"
@ -85,6 +86,27 @@ static void cbTxFontBrowser(Fl_Widget*, void*) {
progdefaults.changed = true;
}
static void cbMacroEditFontBrowser(Fl_Widget*, void*) {
Fl_Font font = font_browser->fontNumber();
int size = font_browser->fontSize();
MacroText->textfont(font);
MacroText->textsize(size);
MacroText->redraw();
progdefaults.MacroEditFontnbr = font;
progdefaults.MacroEditFontsize = size;
update_macroedit_font();
MacroText->textfont(font);
MacroText->textsize(size);
font_browser->hide();
progdefaults.changed = true;
}
void cbWaterfallFontBrowser(Fl_Widget*, void*) {
Fl_Font fnt = font_browser->fontNumber();
int size = font_browser->fontSize();
@ -1146,6 +1168,18 @@ static void cb_btnTxFont(Fl_Button*, void*) {
font_browser->show();
}
Fl_Input *MacroText=(Fl_Input *)0;
Fl_Button *btnMacroEditFont=(Fl_Button *)0;
static void cb_btnMacroEditFont(Fl_Button*, void*) {
font_browser->fontNumber(progdefaults.MacroEditFontnbr);
font_browser->fontSize(progdefaults.MacroEditFontsize);
font_browser->fontFilter(Font_Browser::ALL_TYPES);
font_browser->callback(cbMacroEditFontBrowser);
font_browser->show();
}
Fl_Button *btnXMIT=(Fl_Button *)0;
static void cb_btnXMIT(Fl_Button*, void*) {
@ -5311,6 +5345,7 @@ Fl_Double_Window* ConfigureDialog() {
tabOperator->tooltip(_("Operator information"));
tabOperator->callback((Fl_Callback*)cb_tabOperator);
tabOperator->when(FL_WHEN_CHANGED);
tabOperator->hide();
{ Fl_Group* o = new Fl_Group(55, 35, 490, 170, _("Station"));
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
@ -5419,7 +5454,6 @@ Fl_Double_Window* ConfigureDialog() {
} // Fl_Group* tabOperator
{ tabUI = new Fl_Group(0, 25, 600, 355, _("UI"));
tabUI->tooltip(_("User Interface"));
tabUI->hide();
{ tabsUI = new Fl_Tabs(0, 25, 600, 355);
tabsUI->selection_color(FL_LIGHT1);
{ tabBrowser = new Fl_Group(0, 50, 600, 330, _("Browser"));
@ -6194,7 +6228,7 @@ ab and newline are automatically included."));
tabColorsFonts->tooltip(_("User Interface - Colors / Fonts"));
{ tabsColors = new Fl_Tabs(0, 55, 600, 325);
{ Fl_Group* o = new Fl_Group(0, 75, 600, 305, _("Rx/Tx"));
{ Fl_ListBox* o = listbox_charset_status = new Fl_ListBox(99, 109, 165, 24, _("Rx/Tx Character set"));
{ Fl_ListBox* o = listbox_charset_status = new Fl_ListBox(96, 85, 165, 24, _("Rx/Tx Character set"));
listbox_charset_status->tooltip(_("Select Rx/Tx Character Set"));
listbox_charset_status->box(FL_BORDER_BOX);
listbox_charset_status->color((Fl_Color)55);
@ -6209,67 +6243,75 @@ ab and newline are automatically included."));
listbox_charset_status->callback(cb_listbox_charset, 0);
listbox_charset_status->end();
} // Fl_ListBox* listbox_charset_status
{ RxText = new Fl_Input(99, 143, 165, 36);
{ RxText = new Fl_Input(96, 116, 220, 36);
RxText->value("Receive Text");
RxText->color(fl_rgb_color(progdefaults.RxColor.R, progdefaults.RxColor.G, progdefaults.RxColor.B));
RxText->textfont(progdefaults.RxFontnbr); RxText->textsize(progdefaults.RxFontsize); RxText->textcolor(progdefaults.RxFontcolor);
RxText->type(FL_MULTILINE_INPUT_WRAP);
} // Fl_Input* RxText
{ btnRxColor = new Fl_Button(273, 150, 75, 21, _("Rx bkgnd"));
{ btnRxColor = new Fl_Button(326, 123, 75, 21, _("Rx bkgnd"));
btnRxColor->callback((Fl_Callback*)cb_btnRxColor);
} // Fl_Button* btnRxColor
{ btnTxColor = new Fl_Button(273, 191, 75, 21, _("Tx bkgnd"));
{ btnTxColor = new Fl_Button(326, 166, 75, 21, _("Tx bkgnd"));
btnTxColor->callback((Fl_Callback*)cb_btnTxColor);
} // Fl_Button* btnTxColor
{ TxText = new Fl_Input(99, 186, 165, 37);
{ TxText = new Fl_Input(96, 158, 220, 37);
TxText->value("Transmit Text");
TxText->color(fl_rgb_color(progdefaults.TxColor.R, progdefaults.TxColor.G, progdefaults.TxColor.B));
TxText->textfont(progdefaults.TxFontnbr); TxText->textsize(progdefaults.TxFontsize); TxText->textcolor(progdefaults.TxFontcolor);
TxText->type(FL_MULTILINE_INPUT_WRAP);
} // Fl_Input* TxText
{ btnRxFont = new Fl_Button(358, 150, 75, 21, _("Rx font"));
{ btnRxFont = new Fl_Button(411, 123, 75, 21, _("Rx font"));
btnRxFont->callback((Fl_Callback*)cb_btnRxFont);
} // Fl_Button* btnRxFont
{ btnTxFont = new Fl_Button(358, 191, 75, 21, _("Tx font"));
{ btnTxFont = new Fl_Button(411, 166, 75, 21, _("Tx font"));
btnTxFont->callback((Fl_Callback*)cb_btnTxFont);
} // Fl_Button* btnTxFont
{ Fl_Group* o = new Fl_Group(71, 235, 404, 81, _("Text Highlighting"));
{ MacroText = new Fl_Input(96, 201, 220, 37);
MacroText->value("Macro editor text");
MacroText->textfont(progdefaults.MacroEditFontnbr); TxText->textsize(progdefaults.MacroEditFontsize);
MacroText->type(FL_MULTILINE_INPUT_WRAP);
} // Fl_Input* MacroText
{ btnMacroEditFont = new Fl_Button(326, 209, 120, 21, _("Macro Edit Font"));
btnMacroEditFont->callback((Fl_Callback*)cb_btnMacroEditFont);
} // Fl_Button* btnMacroEditFont
{ Fl_Group* o = new Fl_Group(86, 248, 404, 81, _("Text Highlighting"));
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP|FL_ALIGN_INSIDE));
{ btnXMIT = new Fl_Button(89, 263, 40, 21, _("XMIT"));
{ btnXMIT = new Fl_Button(104, 276, 40, 21, _("XMIT"));
btnXMIT->tooltip(_("Sent chars in Rx/Tx pane"));
btnXMIT->callback((Fl_Callback*)cb_btnXMIT);
btnXMIT->align(Fl_Align(FL_ALIGN_BOTTOM));
btnXMIT->color(progdefaults.XMITcolor);
} // Fl_Button* btnXMIT
{ btnCTRL = new Fl_Button(132, 263, 40, 21, _("CTRL"));
{ btnCTRL = new Fl_Button(147, 276, 40, 21, _("CTRL"));
btnCTRL->tooltip(_("Control chars in Rx/Tx pane"));
btnCTRL->callback((Fl_Callback*)cb_btnCTRL);
btnCTRL->align(Fl_Align(FL_ALIGN_BOTTOM));
btnCTRL->color(progdefaults.CTRLcolor);
} // Fl_Button* btnCTRL
{ btnSKIP = new Fl_Button(176, 263, 40, 21, _("SKIP"));
{ btnSKIP = new Fl_Button(191, 276, 40, 21, _("SKIP"));
btnSKIP->tooltip(_("Skipped chars in Tx pane\n(Tx on/off in CW)"));
btnSKIP->callback((Fl_Callback*)cb_btnSKIP);
btnSKIP->align(Fl_Align(FL_ALIGN_BOTTOM));
btnSKIP->color(progdefaults.SKIPcolor);
} // Fl_Button* btnSKIP
{ btnALTR = new Fl_Button(219, 263, 40, 21, _("ALTR"));
{ btnALTR = new Fl_Button(234, 276, 40, 21, _("ALTR"));
btnALTR->tooltip(_("Alternate character color in Rx panelr"));
btnALTR->callback((Fl_Callback*)cb_btnALTR);
btnALTR->align(Fl_Align(FL_ALIGN_BOTTOM));
btnALTR->color(progdefaults.ALTRcolor);
} // Fl_Button* btnALTR
{ btnSEL = new Fl_Button(263, 263, 39, 21, _("SEL"));
{ btnSEL = new Fl_Button(278, 276, 39, 21, _("SEL"));
btnSEL->tooltip(_("Selection background color in Rx Tx panels"));
btnSEL->callback((Fl_Callback*)cb_btnSEL);
btnSEL->align(Fl_Align(FL_ALIGN_BOTTOM));
btnSEL->color(progdefaults.RxTxSelectcolor);
} // Fl_Button* btnSEL
{ btnNoTextColor = new Fl_Button(310, 263, 70, 21, _("System"));
{ btnNoTextColor = new Fl_Button(325, 276, 70, 21, _("System"));
btnNoTextColor->callback((Fl_Callback*)cb_btnNoTextColor);
} // Fl_Button* btnNoTextColor
{ btnTextDefaults = new Fl_Button(384, 263, 70, 21, _("Defaults"));
{ btnTextDefaults = new Fl_Button(399, 276, 70, 21, _("Defaults"));
btnTextDefaults->callback((Fl_Callback*)cb_btnTextDefaults);
} // Fl_Button* btnTextDefaults
o->end();
@ -6557,7 +6599,7 @@ ab and newline are automatically included."));
} // Fl_Group* o
tabsColors->end();
} // Fl_Tabs* tabsColors
{ Fl_Check_Button* o = btn_show_all_codes = new Fl_Check_Button(105, 325, 25, 25, _("display Rx control chars as ascii string"));
{ Fl_Check_Button* o = btn_show_all_codes = new Fl_Check_Button(105, 335, 25, 25, _("display Rx control chars as ascii string"));
btn_show_all_codes->down_box(FL_DOWN_BOX);
btn_show_all_codes->callback((Fl_Callback*)cb_btn_show_all_codes);
o->value(progdefaults.show_all_codes);

Wyświetl plik

@ -98,6 +98,9 @@ decl {\#include "rx_extract.h"} {private local
decl {\#include "kmlserver.h"} {private local
}
decl {\#include "macroedit.h"} {selected private local
}
decl {extern void WefaxDestDirSet(Fl_File_Chooser *w, void *userdata);} {private local
}
@ -168,6 +171,28 @@ Function {cbTxFontBrowser(Fl_Widget*, void*)} {private return_type void
progdefaults.changed = true;} {}
}
Function {cbMacroEditFontBrowser(Fl_Widget*, void*)} {open private return_type void
} {
code {Fl_Font font = font_browser->fontNumber();
int size = font_browser->fontSize();
MacroText->textfont(font);
MacroText->textsize(size);
MacroText->redraw();
progdefaults.MacroEditFontnbr = font;
progdefaults.MacroEditFontsize = size;
update_macroedit_font();
MacroText->textfont(font);
MacroText->textsize(size);
font_browser->hide();
progdefaults.changed = true;} {}
}
Function {cbWaterfallFontBrowser(Fl_Widget*, void*)} {return_type void
} {
code {Fl_Font fnt = font_browser->fontNumber();
@ -180,7 +205,7 @@ Function {cbWaterfallFontBrowser(Fl_Widget*, void*)} {return_type void
font_browser->hide();} {}
}
Function {cbMacroBtnFontBrowser(Fl_Widget*, void*)} {open private return_type void
Function {cbMacroBtnFontBrowser(Fl_Widget*, void*)} {private return_type void
} {
code {progdefaults.MacroBtnFontnbr = font_browser->fontNumber();
progdefaults.MacroBtnFontsize = font_browser->fontSize();;
@ -217,7 +242,7 @@ Function {cbViewerFontBrowser(Fl_Widget*, void*)} {return_type void
font_browser->hide();} {}
}
Function {cbFreqControlFontBrowser(Fl_Widget*, void*)} {open return_type void
Function {cbFreqControlFontBrowser(Fl_Widget*, void*)} {return_type void
} {
code {Fl_Font fnt = font_browser->fontNumber();
progdefaults.FreqControlFontnbr = fnt;
@ -322,8 +347,8 @@ static const char szProsigns[] = "~|%|&|+|=|{|}|<|>|[|]| ";} {}
} {
Fl_Group tabOperator {
label Operator
callback {progdefaults.changed = true;} open selected
tooltip {Operator information} xywh {0 25 600 355} when 1
callback {progdefaults.changed = true;} open
tooltip {Operator information} xywh {0 25 600 355} when 1 hide
} {
Fl_Group {} {
label Station open
@ -403,7 +428,7 @@ progdefaults.changed = true;}
}
Fl_Group tabUI {
label UI open
tooltip {User Interface} xywh {0 25 600 355} hide
tooltip {User Interface} xywh {0 25 600 355}
} {
Fl_Tabs tabsUI {open
xywh {0 25 600 355} selection_color 50
@ -1327,14 +1352,14 @@ WF_UI();}
} {
Fl_Group listbox_charset_status {
label {Rx/Tx Character set} open
tooltip {Select Rx/Tx Character Set} xywh {99 109 165 24} box BORDER_BOX color 55 align 8
tooltip {Select Rx/Tx Character Set} xywh {96 85 165 24} box BORDER_BOX color 55 align 8
code0 {\#include "fl_digi.h"}
code1 {o->labelsize(FL_NORMAL_SIZE);
listbox_charset_status->callback(cb_listbox_charset, 0);}
class Fl_ListBox
} {}
Fl_Input RxText {
xywh {99 143 165 36}
xywh {96 116 220 36}
code0 {RxText->value("Receive Text");}
code1 {RxText->color(fl_rgb_color(progdefaults.RxColor.R, progdefaults.RxColor.G, progdefaults.RxColor.B));}
code2 {RxText->textfont(progdefaults.RxFontnbr); RxText->textsize(progdefaults.RxFontsize); RxText->textcolor(progdefaults.RxFontcolor);}
@ -1359,7 +1384,7 @@ WF_UI();}
ReceiveText->redraw();
progdefaults.changed = true;}
xywh {273 150 75 21}
xywh {326 123 75 21}
}
Fl_Button btnTxColor {
label {Tx bkgnd}
@ -1380,10 +1405,10 @@ WF_UI();}
TransmitText->redraw();
progdefaults.changed = true;}
xywh {273 191 75 21}
xywh {326 166 75 21}
}
Fl_Input TxText {
xywh {99 186 165 37}
xywh {96 158 220 37}
code0 {TxText->value("Transmit Text");}
code1 {TxText->color(fl_rgb_color(progdefaults.TxColor.R, progdefaults.TxColor.G, progdefaults.TxColor.B));}
code2 {TxText->textfont(progdefaults.TxFontnbr); TxText->textsize(progdefaults.TxFontsize); TxText->textcolor(progdefaults.TxFontcolor);}
@ -1397,7 +1422,7 @@ progdefaults.changed = true;}
font_browser->fontFilter(Font_Browser::ALL_TYPES);
font_browser->callback(cbRxFontBrowser);
font_browser->show();}
xywh {358 150 75 21}
xywh {411 123 75 21}
}
Fl_Button btnTxFont {
label {Tx font}
@ -1407,11 +1432,26 @@ font_browser->show();}
font_browser->fontFilter(Font_Browser::ALL_TYPES);
font_browser->callback(cbTxFontBrowser);
font_browser->show();}
xywh {358 191 75 21}
xywh {411 166 75 21}
}
Fl_Input MacroText {
xywh {96 201 220 37}
code0 {MacroText->value("Macro editor text");}
code1 {MacroText->textfont(progdefaults.MacroEditFontnbr); TxText->textsize(progdefaults.MacroEditFontsize);}
code2 {MacroText->type(FL_MULTILINE_INPUT_WRAP);}
}
Fl_Button btnMacroEditFont {
label {Macro Edit Font}
callback {font_browser->fontNumber(progdefaults.MacroEditFontnbr);
font_browser->fontSize(progdefaults.MacroEditFontsize);
font_browser->fontFilter(Font_Browser::ALL_TYPES);
font_browser->callback(cbMacroEditFontBrowser);
font_browser->show();}
xywh {326 209 120 21}
}
Fl_Group {} {
label {Text Highlighting} open
xywh {71 235 404 81} box ENGRAVED_FRAME align 17
xywh {86 248 404 81} box ENGRAVED_FRAME align 17
} {
Fl_Button btnXMIT {
label XMIT
@ -1422,7 +1462,7 @@ font_browser->show();}
ReceiveText->setFontColor(progdefaults.XMITcolor, FTextBase::XMIT);
progdefaults.changed = true;}
tooltip {Sent chars in Rx/Tx pane} xywh {89 263 40 21} align 2
tooltip {Sent chars in Rx/Tx pane} xywh {104 276 40 21} align 2
code0 {btnXMIT->color(progdefaults.XMITcolor);}
}
Fl_Button btnCTRL {
@ -1434,7 +1474,7 @@ font_browser->show();}
ReceiveText->setFontColor(progdefaults.CTRLcolor, FTextBase::CTRL);
progdefaults.changed = true;}
tooltip {Control chars in Rx/Tx pane} xywh {132 263 40 21} align 2
tooltip {Control chars in Rx/Tx pane} xywh {147 276 40 21} align 2
code0 {btnCTRL->color(progdefaults.CTRLcolor);}
}
Fl_Button btnSKIP {
@ -1447,7 +1487,7 @@ font_browser->show();}
progdefaults.changed = true;}
tooltip {Skipped chars in Tx pane
(Tx on/off in CW)} xywh {176 263 40 21} align 2
(Tx on/off in CW)} xywh {191 276 40 21} align 2
code0 {btnSKIP->color(progdefaults.SKIPcolor);}
}
Fl_Button btnALTR {
@ -1459,7 +1499,7 @@ font_browser->show();}
ReceiveText->setFontColor(progdefaults.ALTRcolor, FTextBase::ALTR);
progdefaults.changed = true;}
tooltip {Alternate character color in Rx panelr} xywh {219 263 40 21} align 2
tooltip {Alternate character color in Rx panelr} xywh {234 276 40 21} align 2
code0 {btnALTR->color(progdefaults.ALTRcolor);}
}
Fl_Button btnSEL {
@ -1481,7 +1521,7 @@ TransmitText->color(
progdefaults.RxTxSelectcolor);
progdefaults.changed = true;}
tooltip {Selection background color in Rx Tx panels} xywh {263 263 39 21} align 2
tooltip {Selection background color in Rx Tx panels} xywh {278 276 39 21} align 2
code0 {btnSEL->color(progdefaults.RxTxSelectcolor);}
}
Fl_Button btnNoTextColor {
@ -1540,7 +1580,7 @@ progdefaults.changed = true;}
TransmitText->redraw();
progdefaults.changed = true;}
xywh {310 263 70 21}
xywh {325 276 70 21}
}
Fl_Button btnTextDefaults {
label Defaults
@ -1599,7 +1639,7 @@ progdefaults.changed = true;}
TransmitText->redraw();
progdefaults.changed = true;}
xywh {384 263 70 21}
xywh {399 276 70 21}
}
}
}
@ -2334,7 +2374,7 @@ progdefaults.changed = true;}
label {display Rx control chars as ascii string}
callback {progdefaults.show_all_codes=o->value();
progdefaults.changed = true;}
xywh {105 325 25 25} down_box DOWN_BOX
xywh {105 335 25 25} down_box DOWN_BOX
code0 {o->value(progdefaults.show_all_codes);}
}
}

Wyświetl plik

@ -152,6 +152,8 @@ extern Fl_Button *btnTxColor;
extern Fl_Input *TxText;
extern Fl_Button *btnRxFont;
extern Fl_Button *btnTxFont;
extern Fl_Input *MacroText;
extern Fl_Button *btnMacroEditFont;
extern Fl_Button *btnXMIT;
extern Fl_Button *btnCTRL;
extern Fl_Button *btnSKIP;

Wyświetl plik

@ -1698,7 +1698,13 @@
ELEM_(bool, view_smeter, "VIEW_SMETER", \
"Enabled, View smeter & power meter\n" \
"Disable, (default)", \
false)
false) \
ELEM_(Fl_Font, MacroEditFontnbr, "MACROEDITFONTNBR", \
"RX text font index", \
FL_HELVETICA) \
ELEM_(int, MacroEditFontsize, "MACROEDITFONTSIZE", \
"RX text font size", \
16)
// declare the struct

Wyświetl plik

@ -47,5 +47,6 @@ extern Fl_Double_Window* make_macroeditor();
enum { MACRO_EDIT_BUTTON, MACRO_EDIT_INPUT };
extern void editMacro(int b, int t = MACRO_EDIT_BUTTON, Fl_Input* in = 0);
extern void update_macro_button(int iMacro, const char *text, const char *name);
extern void update_macroedit_font();
#endif

Wyświetl plik

@ -472,8 +472,19 @@ void editMacro(int n, int t, Fl_Input* in)
macrotext->value(in->value());
labeltext->hide();
}
macrotext->textfont(progdefaults.MacroEditFontnbr);
macrotext->textsize(progdefaults.MacroEditFontsize);
iMacro = n;
iType = t;
iInput = in;
MacroEditDialog->show();
}
void update_macroedit_font()
{
if (!MacroEditDialog) return;
if (!MacroEditDialog->visible()) return;
macrotext->textfont(progdefaults.MacroEditFontnbr);
macrotext->textsize(progdefaults.MacroEditFontsize);
MacroEditDialog->redraw();
}