📄 mutebrightoutlook.c
字号:
/*****************************************************************************
* Copyright (C) 2001 Acer Labs, Inc. All Rights Reserved.
* File: ui_TimeSearch.c
* Contents: TimeSearch process
* History:
* Date By Reason Ver.
* ======== ==== ========= ==========
* 2004.6.4 Gushun Chen Create it 1.0
*****************************************************************************/
#include <comsub.h>
#include <platform.h>
#include <ui.h>
#include <ui_sub.h>
#include <vobu.h>
#include <setupfunc.h>
#include "uiosd.h"
#include "NMOSD.h"
#include "../fileopenmenu/GuiControl.h"
#if 0
/*----------------------------------------------------------------------------
* Function name: ShowVolumeBar
* Arguments:
* Return value:
* Remark: This function show volume bar
*----------------------------------------------------------------------------*/
void ShowVolumeBar(HDC hdc, int startX, int startY, BYTE Nums, WORD space, BOOL bHighLight)
{
BYTE i;
RECT barRec;
COLORREF VolumeColHIGHL,VolumeCol;
int width = 12;
int height = 16;
int upperleftx;
int upperlefty = startY + 12;
// VolumeCol = GetColorInDef256Palette(133);
// VolumeColHIGHL = GetColorInDef256Palette(235);
VolumeCol = GetColorInDef256Palette(112);
VolumeColHIGHL = GetColorInDef256Palette(5);
if(Nums < 3)
Nums = 3;
else if(Nums > MAX_VOLUME)
Nums = MAX_VOLUME;
if(bHighLight == 0)
{
for(i=MAX_VOLUME-3-1; i>=Nums-3; i--)
{
upperleftx = (startX + 210+6) + 16 + i*(width-1 + space);
SetRect(&barRec, upperleftx, upperlefty, upperleftx+width, upperlefty + height);
GUI_CreateButtonControl2(hdc, &barRec, VolumeCol, VolumeCol, VolumeCol, VolumeCol, "", NORMAL_STRING, 0, 0);
}
}
else
{
for(i=1; i<Nums-3; i++)
{
upperleftx = (startX + 210+6) + 16 + i*(width-1 + space);
SetRect(&barRec, upperleftx, upperlefty, upperleftx+width, upperlefty + height);
GUI_CreateButtonControl2(hdc, &barRec, VolumeColHIGHL, VolumeColHIGHL, VolumeColHIGHL, VolumeColHIGHL, "", NORMAL_STRING, 0, 0);
}
}
}
#endif
#if 0
/*----------------------------------------------------------------------------
* Function name: ShowVolumeBar //gushun for mute volume
* Arguments:
* Return value:
* Remark: This function show volume bar
*----------------------------------------------------------------------------*/
void ShowValueBar(HDC hdc, int startX, int startY, BYTE Nums, WORD space, BOOL bHighLight)
{
BYTE i;
RECT barRec;
COLORREF VolumeColHIGHL,VolumeCol;
int width = 12;
int height = 16;
int upperleftx;
int upperlefty = startY + 12;
// VolumeCol = GetColorInDef256Palette(133);
// VolumeColHIGHL = GetColorInDef256Palette(235);
VolumeCol = GetColorInDef256Palette(112);
VolumeColHIGHL = GetColorInDef256Palette(5);
if(Nums < 0)
Nums = 2;
else if(Nums > MAX_VALUE)
Nums = MAX_VALUE + 2;
else
Nums = Nums + 2;
if(bHighLight == 0)
{
for(i=MAX_VALUE+2-1; i>Nums-1; i--)
{
upperleftx = (startX + 210+6) + 16 + i*(width-1 + space);
SetRect(&barRec, upperleftx, upperlefty, upperleftx+width, upperlefty + height);
GUI_CreateButtonControl2(hdc, &barRec, VolumeCol, VolumeCol, VolumeCol, VolumeCol, "", NORMAL_STRING, 0, 0);
}
}
else
{
for(i=2; i<Nums+1-1; i++)
{
upperleftx = (startX + 210+6) + 16 + i*(width-1 + space);
SetRect(&barRec, upperleftx, upperlefty, upperleftx+width, upperlefty + height);
GUI_CreateButtonControl2(hdc, &barRec, VolumeColHIGHL, VolumeColHIGHL, VolumeColHIGHL, VolumeColHIGHL, "", NORMAL_STRING, 0, 0);
}
}
}
#endif
#if 0
/*----------------------------------------------------------------------------
* Function name: DrawBrightContrastSharp //gushun for Brightness Contrast Sharpness
* Arguments:
* Return value:
* Remark: This function show besides bar
*----------------------------------------------------------------------------*/
void DrawBrightContrastSharp(HDC hdc, BYTE BCSType, BYTE Value, int startX, int startY)
{
HDC hMemDC;
HBITMAP holdbmp;
RECT bsRect;
RECT BarBoxRec;
RECT ItemRec;
RECT ArrowRec;
RECT barBoxRec;
UINT uFormat = DT_SINGLELINE|DT_VCENTER|DT_CENTER|DT_CHARCLIP;
UINT iBitmapID[STATUS_MAX_TYPE]={IM_KARA_BRIGHTNESS, IM_KARA_CONSTRAST, IM_KARA_SHARPNESS};
static BYTE itemString[STATUS_MAX_TYPE][24]=
{
{'\0','B','\0','r','\0','i','\0','g','\0','h','\0','t','\0','n','\0','e','\0','s','\0','s','\0'},
{'\0','C','\0','o','\0','n','\0','t','\0','r','\0','a','\0','s','\0','t','\0'},
{'\0','S','\0','h','\0','a','\0','r','\0','p','\0','n','\0','e','\0','s','\0','s','\0'}
};
hMemDC=InitMemoryDC(hdc, KOK_OUTLOOK_WIDTH, KOK_OUTLOOK_HIGH, &holdbmp);
SetRect(&bsRect, startX-startX, startY-startY, startX + KOK_OUTLOOK_WIDTH - 1-startX, startY + KOK_OUTLOOK_HIGH - 1-startY);
GUI_CreateButtonControl2(hMemDC, &bsRect, GetColorInDef256Palette(253), GetColorInDef256Palette(87), GetColorInDef256Palette(199), CL_BKNOCARE, "", NORMAL_STRING, 0, 0);
SetRect(&BarBoxRec, startX + 10-startX,startY + 4-startY,startX+10+34-startX,startY + 4+34-startY);
GUI_CreateBitmapControl2(hMemDC, &BarBoxRec, CL_BKNOCARE, CL_BKNOCARE, CL_BKNOCARE,iBitmapID[BCSType],0, 0);
SetRect(&ItemRec,startX + 50-startX, startY + (KOK_OUTLOOK_HIGH - 30)/2-startY, startX + 50 + 104+20-startX,startY + (KOK_OUTLOOK_HIGH - 30)/2 + 30 -1-startY);
GUI_CreateButtonControl2(hMemDC, &ItemRec, GetColorInDef256Palette(212), CL_TRANSPARENT, CL_TRANSPARENT, GetColorInDef256Palette(233), itemString[BCSType], UNICODE_STRING, 0, 8);
SetRect(&ArrowRec, 50+104+20-6-20, (KOK_OUTLOOK_HIGH - 30)/2, 50+104+20-6, (KOK_OUTLOOK_HIGH-30)/2 + 30 -1);
DrawSmallArrow(hMemDC, &ArrowRec, 233, uFormat, ARROW_UPDOWN);
SetRect(&barBoxRec, startX + 210 - 14-startX, startY-startY, startX + 210 - 2-startX, startY+ KOK_OUTLOOK_HIGH - 1-startY);
DrawSmallArrow(hMemDC, &barBoxRec, 233, uFormat, ARROW_LEFT_BIG);
SetRect(&barBoxRec, startX + 210 + 226+ 2-startX, startY-startY, startX + 210 + 226 + 14-startX, startY+ KOK_OUTLOOK_HIGH - 1-startY);
DrawSmallArrow(hMemDC, &barBoxRec, 233, uFormat, ARROW_RIGHT_BIG);
ShowValueBar(hMemDC, startX - startX, startY - startY, Value, 4, 0);
ShowValueBar(hMemDC, startX - startX, startY - startY, Value, 4, 1);
BitBlt(hdc, startX, startY, KOK_OUTLOOK_WIDTH, KOK_OUTLOOK_HIGH, hMemDC, 0, 0, SRCCOPY);
DelMemoryDC(hMemDC, holdbmp);
}
#endif
void ShowTheSameBackground()
{
RECT bsRect;
SetRect(&bsRect, KOK_LEFT, KOK_TOP, KOK_LEFT+KOK_OUTLOOK_WIDTH - 1, KOK_TOP+KOK_OUTLOOK_HIGH - 1);
GUI_CreateButtonControl2(gui_hdc, &bsRect, GetColorInDef256Palette(253), GetColorInDef256Palette(87), GetColorInDef256Palette(199), CL_BKNOCARE, "", NORMAL_STRING, 0, 0);
}
void ShowTheLeftIcon_Volume()
{
RECT iconBoxRec;
SetRect(&iconBoxRec, KOK_LEFT+10, KOK_TOP+4, KOK_LEFT+10+34, KOK_TOP+4+34);
GUI_CreateBitmapControl2(gui_hdc, &iconBoxRec, GetColorInDef256Palette(253), GetColorInDef256Palette(253), GetColorInDef256Palette(253), IM_KARA_VOLUME, 0, 0);
}
void ShowTheLeftIcon_BCS(BYTE BCS_status)
{
RECT iconBoxRec;
SetRect(&iconBoxRec, KOK_LEFT+10, KOK_TOP+4, KOK_LEFT+10+34, KOK_TOP+4+34);
if(BCS_status==STATUS_BRIGHTNESS)
GUI_CreateBitmapControl2(gui_hdc, &iconBoxRec, GetColorInDef256Palette(253), GetColorInDef256Palette(253), GetColorInDef256Palette(253), IM_KARA_BRIGHTNESS, 0, 0);
else if(BCS_status==STATUS_CONTRAST)
GUI_CreateBitmapControl2(gui_hdc, &iconBoxRec, GetColorInDef256Palette(253), GetColorInDef256Palette(253), GetColorInDef256Palette(253), IM_KARA_CONSTRAST, 0, 0);
else
GUI_CreateBitmapControl2(gui_hdc, &iconBoxRec, GetColorInDef256Palette(253), GetColorInDef256Palette(253), GetColorInDef256Palette(253), IM_KARA_SHARPNESS, 0, 0);
}
void ShowTheSameOnBackground(HDC hMemDC, UINT iBitmapID, BYTE *itemString)
{
RECT bsRect, barBoxRec, itemRec, iconBoxRec;
UINT uFormat = DT_SINGLELINE|DT_VCENTER|DT_CENTER|DT_CHARCLIP;
HDC hStringMemDC;
HBITMAP holdbmp;
/*
// SetRect(&bsRect, 0, 0, KOK_OUTLOOK_WIDTH - 1, KOK_OUTLOOK_HIGH - 1);
SetRect(&bsRect, KOK_LEFT, KOK_TOP, KOK_LEFT+KOK_OUTLOOK_WIDTH - 1, KOK_TOP+KOK_OUTLOOK_HIGH - 1);
GUI_CreateButtonControl2(hMemDC, &bsRect, GetColorInDef256Palette(253), GetColorInDef256Palette(87), GetColorInDef256Palette(199), CL_BKNOCARE, "", NORMAL_STRING, 0, 0);
*/
// SetRect(&iconBoxRec, 10, 4, 10+34, 4+34);
// SetRect(&iconBoxRec, KOK_LEFT+10, KOK_TOP+4, KOK_LEFT+10+34, KOK_TOP+4+34);
// GUI_CreateBitmapControl2(hMemDC, &iconBoxRec, GetColorInDef256Palette(253), GetColorInDef256Palette(253), GetColorInDef256Palette(253), iBitmapID, 0, 0);
hStringMemDC=InitMemoryDC(hMemDC, 124, 35, &holdbmp);
// SetRect(&itemRec, 50, (KOK_OUTLOOK_HIGH - 30)/2, 50 + 104 + 20, (KOK_OUTLOOK_HIGH - 30)/2 + 30 -1);
SetRect(&itemRec, 0, 0, 104 + 20, (KOK_OUTLOOK_HIGH - 30)/2 + 30 -1);
GUI_CreateButtonControl2(hStringMemDC, &itemRec, GetColorInDef256Palette(212), GetColorInDef256Palette(220), GetColorInDef256Palette(220), GetColorInDef256Palette(233), itemString, UNICODE_STRING, 0, 8);
BitBlt(hMemDC, KOK_LEFT+50, KOK_TOP+3, 124, 35, hStringMemDC, 0, 0, SRCCOPY);
DelMemoryDC(hStringMemDC, holdbmp);
// SetRect(&barBoxRec, 210 - 14, 0, 210 - 2, KOK_OUTLOOK_HIGH - 1);
SetRect(&barBoxRec, KOK_LEFT+210 - 14, KOK_TOP, KOK_LEFT+210 - 2, KOK_TOP+KOK_OUTLOOK_HIGH - 1);
DrawSmallArrow(hMemDC, &barBoxRec, 233, uFormat, ARROW_LEFT_BIG);
// SetRect(&barBoxRec, 210 + 226+ 2, 0, 210 + 226 + 14, KOK_OUTLOOK_HIGH - 1);
SetRect(&barBoxRec, KOK_LEFT+210 + 226+ 2, KOK_TOP, KOK_LEFT+210 + 226 + 14, KOK_TOP+KOK_OUTLOOK_HIGH - 1);
DrawSmallArrow(hMemDC, &barBoxRec, 233, uFormat, ARROW_RIGHT_BIG);
}
void ShowBar(HDC hdc, BYTE TotalNum, BYTE HighlightNum, WORD space)
{
BYTE i;
RECT barRec;
COLORREF barColourHilight, barColour;
int width = 11;
int height = 16;
int barStartX= 210 + ((226 - TotalNum*(width + space))/2) + 2+KOK_LEFT;
int upperleftx;
int upperlefty = 12+KOK_TOP;
barColour = GetColorInDef256Palette(133);
barColourHilight = GetColorInDef256Palette(235);
// barColour = GetColorInDef256Palette(112);
// barColourHilight = GetColorInDef256Palette(5);
for(i=0; i< HighlightNum; i++)
{
upperleftx = barStartX + i*(width + space);
SetRect(&barRec, upperleftx, upperlefty, upperleftx+width, upperlefty + height);
GUI_CreateButtonControl2(hdc, &barRec, barColourHilight, barColourHilight, barColourHilight, barColourHilight, "", NORMAL_STRING, 0, 0);
}
for(i=HighlightNum; i<TotalNum; i++)
{
upperleftx = barStartX + i*(width + space);
SetRect(&barRec, upperleftx, upperlefty, upperleftx+width, upperlefty + height);
GUI_CreateButtonControl2(hdc, &barRec, barColour, barColour, barColour, barColour, "", NORMAL_STRING, 0, 0);
}
}
void DrawBrightContrastSharp(HDC hdc, BYTE BCSType, BYTE Value, int startX, int startY)
{
HDC hMemDC;
HBITMAP holdbmp;
RECT ArrowRec;
UINT uFormat = DT_SINGLELINE|DT_VCENTER|DT_CENTER|DT_CHARCLIP;
UINT iBitmapID[STATUS_MAX_TYPE]={IM_KARA_BRIGHTNESS, IM_KARA_CONSTRAST, IM_KARA_SHARPNESS};
static BYTE itemString[STATUS_MAX_TYPE][24]=
{
{'\0','B','\0','r','\0','i','\0','g','\0','h','\0','t','\0','n','\0','e','\0','s','\0','s','\0'},
{'\0','C','\0','o','\0','n','\0','t','\0','r','\0','a','\0','s','\0','t','\0'},
{'\0','S','\0','h','\0','a','\0','r','\0','p','\0','n','\0','e','\0','s','\0','s','\0'}
};
// hMemDC=InitMemoryDC(hdc, KOK_OUTLOOK_WIDTH, KOK_OUTLOOK_HIGH, &holdbmp);
hMemDC = hdc;
ShowTheSameOnBackground(hMemDC, iBitmapID[BCSType], itemString[BCSType]);
SetRect(&ArrowRec, KOK_LEFT+50+104+20-6-20, KOK_TOP+(KOK_OUTLOOK_HIGH - 30)/2, KOK_LEFT+50+104+20-6, KOK_TOP+(KOK_OUTLOOK_HIGH-30)/2 + 30 -1);
DrawSmallArrow(hMemDC, &ArrowRec, 233, uFormat, ARROW_UPDOWN);
ShowBar(hMemDC, 8, Value, 4);
// BitBlt(hdc, startX, startY, KOK_OUTLOOK_WIDTH, KOK_OUTLOOK_HIGH, hMemDC, 0, 0, SRCCOPY);
// DelMemoryDC(hMemDC, holdbmp);
}
/*----------------------------------------------------------------------------
* Function name: ShowMuteVolumeOnBotBlk
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -