diff --git a/src/dialogs/fl_digi.cxx b/src/dialogs/fl_digi.cxx index 492c57ae..1d144298 100644 --- a/src/dialogs/fl_digi.cxx +++ b/src/dialogs/fl_digi.cxx @@ -3990,6 +3990,11 @@ UI_return: text_panel->position( orgx, orgy, nux, nuy); + RigControlFrame->init_sizes(); + RigControlFrame->redraw(); + smeter->redraw(); + pwrmeter->redraw(); + center_group->redraw(); wefax_group->redraw(); fsq_group->redraw(); diff --git a/src/include/pwrmeter.h b/src/include/pwrmeter.h index bc5da02c..4741ab17 100644 --- a/src/include/pwrmeter.h +++ b/src/include/pwrmeter.h @@ -69,6 +69,7 @@ public: void value(double v) { value_ = v; redraw(); } double value() const { return (value_); } + void resize(int x, int y, int w, int h); void set_background(Fl_Color c1) { bgnd_ = c1; redraw(); } void set_metercolor(Fl_Color c2) { fgnd_ = c2; redraw(); } @@ -83,5 +84,6 @@ private: void select_200W(); }; + #endif // !pwrmeter diff --git a/src/include/smeter.h b/src/include/smeter.h index 23c1d108..21526524 100644 --- a/src/include/smeter.h +++ b/src/include/smeter.h @@ -76,6 +76,7 @@ public: redraw(); } double value() const { return (value_); } + void resize(int x, int y, int w, int h); void set_background(Fl_Color c1) { bgnd_ = c1; redraw(); } void set_metercolor(Fl_Color c2) { fgnd_ = c2; redraw(); } diff --git a/src/widgets/pwrmeter.cxx b/src/widgets/pwrmeter.cxx index 3ff85e3d..94777487 100644 --- a/src/widgets/pwrmeter.cxx +++ b/src/widgets/pwrmeter.cxx @@ -132,10 +132,10 @@ void PWRmeter::select( int sel ) { redraw(); } -const char * PWRmeter::W25_face = "| : : : : | : : : : | : : : : | : : : : | : : : : | 25"; -const char * PWRmeter::W50_face = "| : | : | : | : | : | 50"; -const char * PWRmeter::W100_face = "| | | | | | | | | | | 100"; -const char * PWRmeter::W200_face = "| : | : | : | : | 200"; +const char * PWRmeter::W25_face = "| : : : : | : : : : | : : : : | : : : : | : : : 25|"; +const char * PWRmeter::W50_face = "| : | : | : | : | : 50|"; +const char * PWRmeter::W100_face = "| | | | | | | | | | 100|"; +const char * PWRmeter::W200_face = "| : | : | : | : 200|"; PWRmeter::PWRmeter(int X, int Y, int W, int H, const char* l) : Fl_Widget(X, Y, W, H, "") @@ -188,6 +188,63 @@ PWRmeter::PWRmeter(int X, int Y, int W, int H, const char* l) meter_width -= fl_width("| 100"); } +void PWRmeter::resize(int X, int Y, int W, int H) { + Fl_Widget::resize(X,Y,W,H); + + bx = Fl::box_dx(box()); + by = Fl::box_dy(box()); + bw = Fl::box_dw(box()); + bh = Fl::box_dh(box()); + + tx = X + bx; + tw = W - bw; + ty = Y + by; + th = H - bh; + + const char *face; + switch (select_) { + case P25: + face = W25_face; + break; + case P50: + face = W50_face; + break; + case P100: + face = W100_face; + break; + case P200: + face = W200_face; + break; + case AUTO: + default: + face = W25_face; + } + + static int fsize = 6; + fl_font(FL_HELVETICA, fsize); + meter_width = fl_width(face); + while ((meter_width < tw) && (fl_height() < th)) { + fsize++; + fl_font(FL_HELVETICA, fsize); + meter_width = fl_width(face); + } + fsize--; + fl_font(FL_HELVETICA, fsize); + meter_width = fl_width(face); + + meter_height = fl_height(); + label(face); + labelfont(FL_HELVETICA); + labelsize(fsize); + labelcolor(scale_color); + + sx = (tw - meter_width) / 2 + fl_width("|") / 2; + + meter_width -= fl_width("| 100"); + +} + + // // End of PWRmeter.cxx // diff --git a/src/widgets/smeter.cxx b/src/widgets/smeter.cxx index abeba00c..84a24911 100644 --- a/src/widgets/smeter.cxx +++ b/src/widgets/smeter.cxx @@ -98,6 +98,40 @@ Smeter::Smeter(int X, int Y, int W, int H, const char* l) sx = (tw - meter_width) / 2; } +void Smeter::resize(int X, int Y, int W, int H) { + Fl_Widget::resize(X,Y,W,H); + + bx = Fl::box_dx(box()); + by = Fl::box_dy(box()); + bw = Fl::box_dw(box()); + bh = Fl::box_dh(box()); + + tx = X + bx; + tw = W - bw; + ty = Y + by; + th = H - bh; + + static int fsize = 6; + fl_font(FL_HELVETICA, fsize); + meter_width = fl_width(meter_face); + while ((meter_width < tw) && (fl_height() < th)) { + fsize++; + fl_font(FL_HELVETICA, fsize); + meter_width = fl_width(meter_face); + } + fsize--; + fl_font(FL_HELVETICA, fsize); + meter_width = fl_width(meter_face); + meter_height = fl_height(); + label(meter_face); + labelfont(FL_HELVETICA); + labelsize(fsize); + labelcolor(scale_color); + + meter_width -= fl_width("|"); + sx = (tw - meter_width) / 2; +} + // // End of Smeter.cxx //