diff --git a/include/controls.cpp b/include/controls.cpp index 552dc98f3..3e6e91708 100755 --- a/include/controls.cpp +++ b/include/controls.cpp @@ -1348,7 +1348,7 @@ void TPushbutton_control::update() const int w = xvt_dwin_get_text_width(win, (char*)(const char*)_caption, -1); int x = r.left + (r.right - r.left - w) / 2; - int y = r.top + (r.bottom - r.top + ascent - descent) / 2; + int y = r.top + (r.bottom - r.top + ascent - (descent+1)) / 2; if (_obj->v.btn->down) { @@ -1358,8 +1358,8 @@ void TPushbutton_control::update() DRAW_CTOOLS ct; xvt_dwin_get_draw_ctools(win, &ct); - ct.opaque_text = FALSE; - ct.fore_color = _obj->v.btn->fore_color; + ct.opaque_text = FALSE; + ct.fore_color = (attrib & XI_ATR_ENABLED) ? _obj->v.btn->fore_color : DISABLED_COLOR; xvt_dwin_set_draw_ctools(win, &ct); xvt_dwin_draw_text(win, x, y, (char*)(const char*)_caption, -1); diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 0870fa0b0..652eb9b4a 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -560,10 +560,10 @@ bool TMask_field::warning_box( bool TMask_field::yesno_box(const char* fmt, ...) const { - set_focus(); build_msg(); + set_focus(); const bool yes = ::yesno_box("%s", _msg); - highlight(); + set_focus(); return yes; } @@ -572,7 +572,7 @@ KEY TMask_field::yesnocancel_box(const char* fmt, ...) const build_msg(); set_focus(); const KEY k = ::yesnocancel_box("%s", _msg); - highlight(); + set_focus(); return k; }