This commit is contained in:
13038267101 2023-01-12 16:48:57 +08:00
commit 6ba0906e8a
3 changed files with 10 additions and 10 deletions

View File

@ -56,9 +56,14 @@ BOOL dlg_indicator::handle_message(UINT msg, WPARAM wp, LPARAM lp)
{
DRAWITEMSTRUCT* ds = (DRAWITEMSTRUCT*)lp;
wchar_t text[128] = { 0 };
SetTextColor(ds->hDC, err_ ? RGB(255, 0, 0) : RGB(0, 0, 0));
SetBkMode(ds->hDC, TRANSPARENT);
HBRUSH brsh = CreateSolidBrush(GetBkColor(ds->hDC));
FillRect(ds->hDC, &ds->rcItem, brsh);
DeleteObject(brsh);
GetWindowTextW(ds->hwndItem, text, _countof(text) - 1);
SetBkMode(ds->hDC, TRANSPARENT);
SetTextColor(ds->hDC, err_ ? RGB(255, 0, 0) : RGB(0, 0, 0));
TextOutW(ds->hDC, 0, 0, text, lstrlenW(text));
}
ret = FALSE;

View File

@ -1109,9 +1109,9 @@ bool scanner::get_option_value_with_parent(int sn, set_opt_value setv, void* par
return handled;
}
bool scanner::set_option_value_with_parent(int sn, void* data, int* err) // return true if handled
bool scanner::set_option_value_with_parent(int sn, void* data, int* err) // return true if handled sn
{
bool handled = true;
bool handled = false;
if (sn == scan_count_id_)
{
@ -1135,11 +1135,6 @@ bool scanner::set_option_value_with_parent(int sn, void* data, int* err) // retu
*err = hg_sane_middleware::instance()->set_option(handle_, scan_mode_id_, SANE_ACTION_SET_VALUE, val, &after);
}
delete[] val;
// handled = false;
}
else
{
handled = false;
}
return handled;

View File

@ -82,7 +82,7 @@ class scanner : public ISaneInvoker, virtual public refer
void extension_erase_color(int id);
bool get_option_value_with_parent(int sn, set_opt_value setv, void* param); // return true if handled
bool set_option_value_with_parent(int sn, void* data, int* err); // return true if handled
bool set_option_value_with_parent(int sn, void* data, int* err); // return true if handled sn
int set_option_value(int sn, SANE_Value_Type type, int size, void* data);
typedef struct _ex_api