//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*
//
//
Module Name:
tab.c
Abstract:
TAB handling routines of regional setting applet.
Author:
Paul Shih (paulsh) 3-Apr-1995
Environment:
User mode only
Note:
*/
#include <windows.h>
#include <windowsx.h>
#include "commctrl.h"
#include "intl.h"
#include "intlid.h"
#include "tab.h"
#include "cplpriv.h"
//
// Local Constants
//
#define MAX_SAMPLE_LEN 40
//
// Function protorypes
//
BOOL APIENTRY TabDlgProc(HWND hDlg, UINT message, UINT wParam, LONG lParam);
BOOL pDisplayTabDialog(int iTab, HWND hwnd);
BOOL pRearrangeZOrder(int idTab);
LPTSTR pMatchPicture(LPTSTR lpszSDateFormet, PNCTSTR pPicture, int n);
#ifdef GRYPHON
VOID DisplayDefaultNumber(PTABINFO pTabInfo);
VOID DisplayDefaultCurrency(PTABINFO pTabInfo);
int WINAPI StrToInt(LPCTSTR lpSrc); // atoi()
#endif // GRYPHON
//
// Global Variables
//
//
HFONT ghDlgFontBold; // handle to bold font
static HWND ghwndTabDlg; // TAB Dialog main window
HWND ghwndTabMain; // main TAB window (used to get/set tab control)
HWND ghwndTabCustomize;
static const TCHAR szSampleNumberPos[]= TEXT("123456789.00"); // Used for currency and number samples
static const TCHAR szSampleNumberNeg[]= TEXT("-123456789.00");// Used for currency and number samples
static const TCHAR szSymbolMissing[]= TEXT("????"); // Used for all
static const TCHAR szFmt0[] = TEXT("000000000");
static const TCHAR szFmt9[] = TEXT("123456789");
static const TCHAR szFmt8[] = TEXT("1%s23456789");
static const TCHAR szFmt7[] = TEXT("12%s3456789");
static const TCHAR szFmt6[] = TEXT("123%s456789");
static const TCHAR szFmt5[] = TEXT("1234%s56789");
static const TCHAR szFmt4[] = TEXT("1%s2345%s6789");
static const TCHAR szFmt3[] = TEXT("123%s456%s789");
static const TCHAR szFmt2[] = TEXT("1%s23%s45%s67%s89");
static const TCHAR szFmt1[] = TEXT("1%s2%s3%s4%s5%s6%s7%s8%s9");
static const LPCTSTR lpszFmt[] = {
szFmt9,
szFmt1,
szFmt2,
szFmt3,
szFmt4,
szFmt5,
szFmt6,
szFmt7,
szFmt8,
szFmt9,
};
// Routine Starts
//
/*++
InitTabs:
WinCE Initialization DLL
Arguments:
iTab : index (starting from 0) to the tab to be set as the initial one.
Return Value:
Always TRUE
--*/
BOOL InitTabs(int iTab)
{
RECT rc;
TC_ITEM tie;
TCHAR szTemp[128];
int index;
// Create TAB main window
ghwndTabDlg = CreateDialog(ghinst,
MAKEINTRESOURCE(TAB_DLG),
ghwndMain,
TabDlgProc);
if (ghwndTabDlg == NULL)
{
return FALSE;
}
ResizeTabDlg(ghwndMain, ghwndTabDlg);
ghwndTabMain = GetDlgItem(ghwndTabDlg, IDC_TAB);
ghDlgFontBold = CREATE_BOLDFONT(ghwndTabDlg);
// Adjust Tab window size
GetClientRect(ghwndTabMain, &rc);
TabCtrl_SetItemSize(ghwndTabMain, (rc.right - rc.left) / TABCOUNTS(), TAB_HEIGHT);
TabCtrl_SetPadding(ghwndTabMain, TAB_PADDINGX, TAB_PADDINGY);
tie.mask = TCIF_TEXT | TCIF_IMAGE;
tie.iImage = -1;
// Create all the tab controls
for (index=0; index<TABCOUNTS(); index++)
{
LOADSTRING(gpTabInfo[ADJUST_ITAB(index)].iNameString, szTemp);
tie.pszText = szTemp;
TabCtrl_InsertItem(ghwndTabMain, index, &tie);
}
TabCtrl_SetCurSel(ghwndTabMain, iTab); // Select the tab desired
pDisplayTabDialog(iTab, NULL);
DEBUGMSG(ZONE_TAB, (L"InitTabs calling Unitialized\r\n"));
InvalidateRect(ghwndTabMain, NULL, TRUE);// Fix border repaint
return TRUE;
}
BOOL InitLocalesTab()
{
TC_ITEM tie;
WCHAR szTemp[128];
RECT rc;
int index;
GetClientRect(ghwndTabMain, &rc);
ghwndTabCustomize = CreateWindow(WC_TABCONTROL,
NULL,
WS_GROUP | WS_TABSTOP,
0,
0,
(rc.right - rc.left),
(rc.bottom - rc.top),
ghwndTabDlg,
NULL,
ghinst,
NULL);
if (!ghwndTabCustomize)
{
return FALSE;
}
TabCtrl_SetItemSize(ghwndTabCustomize,
((rc.right - rc.left) / NUM_LOCALE_TABS),
TAB_HEIGHT);
TabCtrl_SetPadding(ghwndTabCustomize, TAB_PADDINGX, TAB_PADDINGY);
tie.mask = TCIF_TEXT | TCIF_IMAGE;
tie.iImage = -1;
// Create all the tab controls
for (index=0; index < NUM_LOCALE_TABS; index++)
{
LOADSTRING(gpLocaleTabInfo[index].iNameString, szTemp);
tie.pszText = szTemp;
TabCtrl_InsertItem(ghwndTabCustomize, index, &tie);
}
TabCtrl_SetCurSel(ghwndTabCustomize, 0);
pDisplayTabDialog(0, NULL);
ShowWindow(ghwndTabCustomize, SW_SHOW);
ShowWindow(ghwndTabMain, SW_HIDE);
return TRUE;
}
/*++
InitTab:
Initialize a TAB when it becomes activated.
Arguments:
pTabInfo: points to the TABINFO structure of the tab to be initialized
Return Value:
TRUE : no error
FALSE: error occurred.
--*/
BOOL InitTab(PTABINFO pTabInfo)
{
DECLAREWAITCURSOR;
PCOMBOINFO pCombo;
BOOL bRtn = TRUE;
BOOL bWait = FALSE;
for (pCombo=pTabInfo->comboInfo.p;
pCombo!=pTabInfo->comboInfo.p+pTabInfo->comboInfo.n;
pCombo++)
{
if (!pCombo->bInit)
{
// We are going to access registry
// This might take a while.
// So, bring up hour glass.
if (!bWait)
{
bWait = TRUE;
SetWaitCursor();
}
pCombo->bInit = TRUE;
pCombo->bChanged = FALSE;
if (!InitCombo(pCombo))
{
bRtn = FALSE;
pCombo->bInit = FALSE;
}
}
}
(*pTabInfo->pfnDisplay)(pTabInfo);
if (bWait)
{
ResetWaitCursor();
}
return bRtn;
}
/*++
TabDlgProc:
Dialog callback of the ghwndTabDlg (the tab control container)
Arguments:
You know what these are
Return Value:
You know what these are.
--*/
BOOL APIENTRY TabDlgProc(HWND hDlg, UINT message, UINT wParam, LONG lParam)
{
switch (message)
{
case WM_NOTIFY:
DEBUGMSG(ZONE_TAB, (L"TabDlg calling TabNotify. from ID = %d code = %d\n",
((NMHDR *)lParam)->idFrom,
((NMHDR *)lParam)->code));
TabNotify(NULL, ((NMHDR *)lParam)->code);
break;
case WM_HELP:
// Get help file from main window
PostMessage(ghwndMain, message, wParam, lParam);
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
case IDCANCEL:
SetFocus(ghwndMain);
PostMessage(ghwndMain, WM_COMMAND, wParam, lParam);
return TRUE;
default:
return TRUE;
}
break;
case WM_DESTROY:
if (ghDlgFontBold
没有合适的资源?快使用搜索试试~ 我知道了~
wince5.0_control_source.rar_控制面板
共203个文件
ico:70个
cpp:38个
h:26个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 41 浏览量
2022-09-19
14:28:28
上传
评论
收藏 421KB RAR 举报
温馨提示
WinCE5.0控制面板源代码,包含控制面板主程序(control)及相关cpl源码。
资源推荐
资源详情
资源评论
收起资源包目录
wince5.0_control_source.rar_控制面板 (203个子文件)
ok.2bp 134B
close.2bp 134B
left.2bp 106B
right.2bp 106B
down.2bp 102B
up.2bp 102B
stop.2bp 94B
map.bmp 18KB
scheme.bmp 3KB
clapp1.bmp 878B
clapp2.bmp 878B
tab.c 76KB
combo.c 47KB
input.c 30KB
dialogs.c 26KB
intl.c 24KB
tbl.c 9KB
sip_i.c 2KB
colschem.cpp 70KB
dmpnl.cpp 61KB
certcpl.cpp 47KB
power.cpp 38KB
control.cpp 33KB
screen.cpp 29KB
sndschem.cpp 29KB
system.cpp 28KB
cplutils.cpp 25KB
datetime.cpp 19KB
maindlg.cpp 18KB
unloadn.cpp 17KB
cplmain.cpp 16KB
owner.cpp 14KB
volume.cpp 12KB
rootdlg.cpp 11KB
keybd.cpp 11KB
stylus.cpp 10KB
comm.cpp 9KB
acc_keybdd.cpp 9KB
sipcpl.cpp 9KB
base64.cpp 9KB
cpl.cpp 8KB
advbacklight.cpp 8KB
acc_moused.cpp 8KB
partinfodlg.cpp 8KB
cpltable.cpp 8KB
acc_dispd.cpp 7KB
acc_gend.cpp 7KB
passwd.cpp 6KB
stgui.cpp 6KB
acc_soundd.cpp 5KB
ctlpnl.cpp 5KB
copyr.cpp 4KB
remove.cpp 4KB
newpartdlg.cpp 3KB
bthpnl.cpp 3KB
connpnl.cpp 2KB
cplmain.def 2KB
dmpnl.def 536B
intl.def 492B
advbacklight.def 461B
connpnl.def 453B
bthpnl.def 453B
stgui.def 444B
dirs 512B
dirs 449B
dirs 446B
cplres.h 33KB
sip_i.h 14KB
cplmacro.h 13KB
intlid.h 9KB
regcpl.h 8KB
cplglobl.h 7KB
intl.h 7KB
colschem.h 6KB
cplpriv.h 5KB
tab.h 4KB
ce_setup.h 3KB
combo.h 3KB
resource.h 3KB
resource.h 3KB
stgui.h 2KB
unload.h 2KB
contrlrc.h 2KB
cplpch.h 2KB
control.h 2KB
advbacklight.h 1KB
base64.h 1KB
dmpch.h 872B
accglobl.h 714B
resource.h 708B
resource.h 680B
resource.h 679B
bluetooth_new.ico 25KB
bluetooth.ico 25KB
accessib.ico 10KB
comm_new.ico 5KB
profile_new.ico 5KB
remove_new.ico 5KB
date_new.ico 5KB
control_new.ico 5KB
共 203 条
- 1
- 2
- 3
资源评论
alvarocfc
- 粉丝: 105
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功