Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Temperature slider implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
maoserr committed Jul 20, 2014
1 parent 8222784 commit fd4e3cb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/gui/win32gui.c
Expand Up @@ -47,13 +47,34 @@ INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
}else{
guigamma_check((HWND)NULL,(UINT)NULL,(UINT)NULL,(DWORD)NULL);
}
SendMessage(GetDlgItem(gHmain,IDC_MAIN_SL_AUTO), TBM_SETRANGE,
(WPARAM) TRUE, // redraw flag
(LPARAM) MAKELONG(3600, 6500)); // min. & max. positions

SendMessage(GetDlgItem(gHmain,IDC_MAIN_SL_AUTO), TBM_SETPAGESIZE,
0, (LPARAM) 100); // new page size

SendMessage(GetDlgItem(gHmain,IDC_MAIN_SL_AUTO), TBM_SETPOS,
(WPARAM) TRUE, // redraw flag
(LPARAM) 3600);
case WM_COMMAND:
switch(LOWORD(wParam)){
case IDCANCEL:
SendMessage(hDlg, WM_CLOSE, 0, 0);
return TRUE;
}
break;
case WM_HSCROLL:
if( (HWND)lParam == GetDlgItem(gHmain,IDC_MAIN_SL_AUTO)){
DWORD dwPos;
int rounded;
dwPos = SendMessage(GetDlgItem(gHmain,IDC_MAIN_SL_AUTO), TBM_GETPOS, 0, 0);
rounded = 100*((int)(dwPos/100.0f));
LOG(LOGVERBOSE,_("Setting manual temperature: %d"),rounded);
(void)guigamma_set_temp(rounded);
guimain_update_info();
}
break;
case WM_CLOSE:
guigamma_end_timers();
DestroyWindow(hDlg);
Expand Down

0 comments on commit fd4e3cb

Please sign in to comment.