📄 win_syssetdisplay.c
字号:
/*** COMPANY NAME: 国星** FILE NAME: win_sysSetDisplay.c** FILE PATH: Interface/win_sysSetDisplay.c** WINDOWS NAME: 显示设置** WINDOWS PATH: 系统 / 系统设置 / 显示设置** OTHER INFORMATION; 无** CREATER NAME: LiWencheng,JiangYuanqing** MENDER NAME: LiWencheng** CHANGE TIME: 11/4/2007 */#include "sysSrcInfo.h"#define ID_SPINLEFT 234#define ID_SPINRIGHT 235static int currProgress;static HWND hWndProgressbar;static BITMAP bmphWndSetDisplay;//缓存中间状态栏图片static HWND hWndMainhWndSetDisplay;static const char *bmp_name_hWndSetDisplay[] = { "./Pictures/b_windowsbackground_1.PNG", "./Pictures/OK.PNG", "./Pictures/return.PNG", "./Pictures/b_spinbox_0.PNG", "./Pictures/b_spinbox_1.PNG" };/* 定义皮肤元素数组 *///三个button 为左中右, 并不表示它就一定指OK或MENUstatic skin_item_t skinItemshWndSetDisplay [] = { {SIID_OK, SI_TYPE_CHKBUTTON | SI_TEST_SHAPE_RECT | SI_STATUS_VISIBLE, BUTTONLEFT_X, BUTTON_Y, {}, 1, "" }, {SIID_RETURN, SI_TYPE_CHKBUTTON | SI_TEST_SHAPE_RECT | SI_STATUS_VISIBLE, BUTTONRIGHT_X, BUTTON_Y, {}, 2, "" }, {ID_SPINLEFT, SI_TYPE_CHKBUTTON | SI_TEST_SHAPE_RECT | SI_STATUS_VISIBLE, 6, 53, {}, 3, "" }, {ID_SPINRIGHT, SI_TYPE_CHKBUTTON | SI_TEST_SHAPE_RECT | SI_STATUS_VISIBLE, 144, 53, {}, 4, "" }, };/* 定义皮肤 */static skin_head_t skinhWndSetDisplay = { "skinhWndSetDisplay", //const BITMAP* bmps; SKIN_STYLE_TOOLTIP, NULL, NULL, 0, 4, skinItemshWndSetDisplay, FALSE};static void CloseWindow_hWndSetDisplay (){ LoadSkinBmps (&skinhWndSetDisplay, FALSE, bmp_name_hWndSetDisplay, (sizeof (bmp_name_hWndSetDisplay))/sizeof (char *) ); ShowWindow (hWndMainhWndSetDisplay, SW_HIDE); UnloadBitmap ( &bmphWndSetDisplay );}static int main_event_cb_hWndSetDisplay (HWND hwnd, skin_item_t* item, int event, void* data){ if (event == SIE_BUTTON_CLICKED) { switch (item->id) { case SIID_OK: //SendMessage (hWndProgressbar, PBM_SETPOS, 900, 0); SetDisplayHuiDu (currProgress); break; case SIID_RETURN://return win_SysSet (hWndMain ); CloseWindow_hWndSetDisplay (); break; case ID_SPINLEFT: SendMessage (hWndProgressbar, PBM_DELTAPOS, -10, 0); currProgress = currProgress - 10; break; case ID_SPINRIGHT: SendMessage (hWndProgressbar, PBM_DELTAPOS, 10, 0); currProgress = currProgress + 10; break; } } return 1;}static int msg_event_cb_hWndSetDisplay (HWND hwnd, int message, WPARAM wparam, LPARAM lparam, int* result){ HDC hdc; int i; switch (message) { case MSG_CREATE: LoadBitmap (HDC_SCREEN, &bmphWndSetDisplay, "./Pictures/a_sysSysset_1.PNG"); hWndProgressbar = CreateWindowEx ("progressbar", NULL, WS_VISIBLE, WS_EX_USEPARENTCURSOR, 2343, 15, 50, 130, 20, hwnd, 0); SendMessage (hWndProgressbar, PBM_SETRANGE, 0, 1000); currProgress = GetDisplayHuiDu (); SendMessage (hWndProgressbar, PBM_SETPOS, currProgress, 0); //SendMessage (hWndSetDisplay, PBM_SETSTEP, 1, 0); UpdateWindow (hWndProgressbar, TRUE); InvalidateRect (hWndMainSysLook, NULL, TRUE);//re1draw break; case MSG_PAINT : hdc = BeginPaint (hwnd); SetBkMode (hdc, BM_TRANSPARENT); FillBoxWithBitmap (hdc, ZTL_PIC_X, ZTL_PIC_Y, ZTL_PIC_W, ZTL_PIC_H, &bmphWndSetDisplay); TextOut (hdc, WZ_ZTL_X4, WZ_ZTL_Y, "显示设置" ); TextOut (hdc, RJ_X , 23, "灰度调节" ); EndPaint (hwnd, hdc); break; } return 1;}void win_hWndSetDisplay (HWND hwndmain ){ MSG msg; LoadSkinBmps (&skinhWndSetDisplay, TRUE, bmp_name_hWndSetDisplay, (sizeof (bmp_name_hWndSetDisplay))/sizeof (char *) ); if (skinhWndSetDisplay.bmps == NULL) { printf ("Could not load skin bitmaps!\n"); } if (!skin_init (&skinhWndSetDisplay, main_event_cb_hWndSetDisplay, msg_event_cb_hWndSetDisplay) ){ /* 初始化皮肤 */ printf ("skin init fail!\n\n"); } else{ hWndMainhWndSetDisplay = create_skin_control (&skinhWndSetDisplay, hwndmain, 153, DEF_X_, DEF_Y_, DEF_WIDTH, DEF_HEIGHT); currShowWindowHwnd = hWndMainhWndSetDisplay; }}#ifndef _LITE_VERSION#include <minigui/dti.c>#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -