📄 csharedata_new.cpp
字号:
/* 「開く」ダイアログのサイズと位置 */
const char* pszKeyName = "rcOpenDialog";
const char* pszForm = "%d,%d,%d,%d";
char szKeyData[1024];
if( bRead ){
if( true == cProfile.IOProfileData( bRead, pszSecName, pszKeyName, szKeyData, sizeof( szKeyData )) ){
sscanf( szKeyData, pszForm,
&common.m_rcOpenDialog.left,
&common.m_rcOpenDialog.top,
&common.m_rcOpenDialog.right,
&common.m_rcOpenDialog.bottom
);
}
}else{
wsprintf( szKeyData, pszForm,
common.m_rcOpenDialog.left,
common.m_rcOpenDialog.top,
common.m_rcOpenDialog.right,
common.m_rcOpenDialog.bottom
);
cProfile.IOProfileData( bRead, pszSecName, pszKeyName, szKeyData, 0 );
}
//2002.02.08 aroka,hor
cProfile.IOProfileData( bRead, pszSecName, "bMarkUpBlankLineEnable" , common.m_bMarkUpBlankLineEnable );
cProfile.IOProfileData( bRead, pszSecName, "bFunclistSetFocusOnJump" , common.m_bFunclistSetFocusOnJump );
// Apr. 05, 2003 genta ウィンドウキャプションのカスタマイズ
cProfile.IOProfileData( bRead, pszSecName, "szWinCaptionActive"
, common.m_szWindowCaptionActive, MAX_CAPTION_CONF_LEN );
cProfile.IOProfileData( bRead, pszSecName, "szWinCaptionInactive"
, common.m_szWindowCaptionInactive, MAX_CAPTION_CONF_LEN );
}
/*!
@brief 共有データのToolbarセクションの入出力
@param[in] bRead true: 読み込み / false: 書き込み
@param[in,out] cProfile INIファイル入出力クラス
@date 2005-04-07 D.S.Koba ShareData_IO_2から分離。読み込み時の初期化を修正
*/
void CShareData::ShareData_IO_Toolbar( const bool bRead, CProfile& cProfile )
{
const char* pszSecName = "Toolbar";
int i;
char szKeyName[64];
Common& common = m_pShareData->m_Common;
cProfile.IOProfileData( bRead, pszSecName, "nToolBarButtonNum", common.m_nToolBarButtonNum );
cProfile.IOProfileData( bRead, pszSecName, "bToolBarIsFlat", common.m_bToolBarIsFlat );
int nSize = common.m_nToolBarButtonNum;
for( i = 0; i < nSize; ++i ){
wsprintf( szKeyName, "nTBB[%03d]", i );
cProfile.IOProfileData( bRead, pszSecName, szKeyName, common.m_nToolBarButtonIdxArr[i] );
}
//読み込み時は残りを初期化
if( bRead ){
for(; i< MAX_TOOLBARBUTTONS; ++i){
common.m_nToolBarButtonIdxArr[i] = 0;
}
}
}
/*!
@brief 共有データのCustMenuセクションの入出力
@param[in] bRead true: 読み込み / false: 書き込み
@param[in,out] cProfile INIファイル入出力クラス
@date 2005-04-07 D.S.Koba ShareData_IO_2から分離。
*/
void CShareData::ShareData_IO_CustMenu( const bool bRead, CProfile& cProfile )
{
const char* pszSecName = "CustMenu";
int i, j;
char szKeyName[64];
Common& common = m_pShareData->m_Common;
for( i = 0; i < MAX_CUSTOM_MENU; ++i ){
wsprintf( szKeyName, "szCMN[%02d]", i );
cProfile.IOProfileData( bRead, pszSecName, szKeyName, common.m_szCustMenuNameArr[i], MAX_CUSTOM_MENU_NAME_LEN + 1 ); // Oct. 15, 2001 genta 最大長指定
wsprintf( szKeyName, "nCMIN[%02d]", i );
cProfile.IOProfileData( bRead, pszSecName, szKeyName, common.m_nCustMenuItemNumArr[i] );
int nSize = common.m_nCustMenuItemNumArr[i];
for( j = 0; j < nSize; ++j ){
wsprintf( szKeyName, "nCMIF[%02d][%02d]", i, j );
cProfile.IOProfileData( bRead, pszSecName, szKeyName, common.m_nCustMenuItemFuncArr[i][j] );
wsprintf( szKeyName, "nCMIK[%02d][%02d]", i, j );
cProfile.IOProfileData( bRead, pszSecName, szKeyName, common.m_nCustMenuItemKeyArr[i][j] );
}
}
}
/*!
@brief 共有データのFontセクションの入出力
@param[in] bRead true: 読み込み / false: 書き込み
@param[in,out] cProfile INIファイル入出力クラス
@date 2005-04-07 D.S.Koba ShareData_IO_2から分離。
*/
void CShareData::ShareData_IO_Font( const bool bRead, CProfile& cProfile )
{
const char* pszSecName = "Font";
const char* pszForm = "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d";
char szKeyData[1024];
Common& common = m_pShareData->m_Common;
if( bRead ){
if( true == cProfile.IOProfileData( bRead, pszSecName, "lf", szKeyData, sizeof( szKeyData )) ){
sscanf( szKeyData, pszForm,
&common.m_lf.lfHeight,
&common.m_lf.lfWidth,
&common.m_lf.lfEscapement,
&common.m_lf.lfOrientation,
&common.m_lf.lfWeight,
&common.m_lf.lfItalic,
&common.m_lf.lfUnderline,
&common.m_lf.lfStrikeOut,
&common.m_lf.lfCharSet,
&common.m_lf.lfOutPrecision,
&common.m_lf.lfClipPrecision,
&common.m_lf.lfQuality,
&common.m_lf.lfPitchAndFamily
);
}
}else{
wsprintf( szKeyData, pszForm,
common.m_lf.lfHeight,
common.m_lf.lfWidth,
common.m_lf.lfEscapement,
common.m_lf.lfOrientation,
common.m_lf.lfWeight,
common.m_lf.lfItalic,
common.m_lf.lfUnderline,
common.m_lf.lfStrikeOut,
common.m_lf.lfCharSet,
common.m_lf.lfOutPrecision,
common.m_lf.lfClipPrecision,
common.m_lf.lfQuality,
common.m_lf.lfPitchAndFamily
);
cProfile.IOProfileData( bRead, pszSecName, "lf", szKeyData, 0 );
}
cProfile.IOProfileData( bRead, pszSecName, "lfFaceName",
common.m_lf.lfFaceName, sizeof( common.m_lf.lfFaceName ));
cProfile.IOProfileData( bRead, pszSecName, "bFontIs_FIXED_PITCH", common.m_bFontIs_FIXED_PITCH );
}
/*!
@brief 共有データのKeyBindセクションの入出力
@param[in] bRead true: 読み込み / false: 書き込み
@param[in,out] cProfile INIファイル入出力クラス
@date 2005-04-07 D.S.Koba ShareData_IO_2から分離。
*/
void CShareData::ShareData_IO_KeyBind( const bool bRead, CProfile& cProfile )
{
const char* pszSecName = "KeyBind";
int i;
char szKeyName[64];
char szKeyData[1024];
int nSize = m_pShareData->m_nKeyNameArrNum;
for( i = 0; i < nSize; ++i ){
// 2005.04.07 D.S.Koba
KEYDATA& keydata = m_pShareData->m_pKeyNameArr[i];
strcpy( szKeyName, keydata.m_szKeyName );
if( bRead ){
if( true == cProfile.IOProfileData( bRead, pszSecName, szKeyName,
szKeyData, sizeof( szKeyData )) ){
sscanf( szKeyData, "%d,%d,%d,%d,%d,%d,%d,%d",
&keydata.m_nFuncCodeArr[0],
&keydata.m_nFuncCodeArr[1],
&keydata.m_nFuncCodeArr[2],
&keydata.m_nFuncCodeArr[3],
&keydata.m_nFuncCodeArr[4],
&keydata.m_nFuncCodeArr[5],
&keydata.m_nFuncCodeArr[6],
&keydata.m_nFuncCodeArr[7]
);
}
}else{
wsprintf( szKeyData, "%d,%d,%d,%d,%d,%d,%d,%d",
keydata.m_nFuncCodeArr[0],
keydata.m_nFuncCodeArr[1],
keydata.m_nFuncCodeArr[2],
keydata.m_nFuncCodeArr[3],
keydata.m_nFuncCodeArr[4],
keydata.m_nFuncCodeArr[5],
keydata.m_nFuncCodeArr[6],
keydata.m_nFuncCodeArr[7]
);
cProfile.IOProfileData( bRead, pszSecName, szKeyName, szKeyData, 0 );
}
}
}
/*!
@brief 共有データのPrintセクションの入出力
@param[in] bRead true: 読み込み / false: 書き込み
@param[in,out] cProfile INIファイル入出力クラス
@date 2005-04-07 D.S.Koba ShareData_IO_2から分離。
*/
void CShareData::ShareData_IO_Print( const bool bRead, CProfile& cProfile )
{
const char* pszSecName = "Print";
int i, j;
char szKeyName[64];
char szKeyData[1024];
for( i = 0; i < MAX_PRINTSETTINGARR; ++i ){
// 2005.04.07 D.S.Koba
PRINTSETTING& printsetting = m_pShareData->m_PrintSettingArr[i];
wsprintf( szKeyName, "PS[%02d].nInts", i );
static const char* pszForm = "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d";
if( bRead ){
if( true == cProfile.IOProfileData( bRead, pszSecName, szKeyName,
szKeyData, sizeof( szKeyData ) ) ){
sscanf( szKeyData, pszForm,
&printsetting.m_nPrintFontWidth ,
&printsetting.m_nPrintFontHeight ,
&printsetting.m_nPrintDansuu ,
&printsetting.m_nPrintDanSpace ,
&printsetting.m_nPrintLineSpacing ,
&printsetting.m_nPrintMarginTY ,
&printsetting.m_nPrintMarginBY ,
&printsetting.m_nPrintMarginLX ,
&printsetting.m_nPrintMarginRX ,
&printsetting.m_nPrintPaperOrientation,
&printsetting.m_nPrintPaperSize ,
&printsetting.m_bPrintWordWrap ,
&printsetting.m_bPrintLineNumber ,
&printsetting.m_bHeaderUse[0] ,
&printsetting.m_bHeaderUse[1] ,
&printsetting.m_bHeaderUse[2] ,
&printsetting.m_bFooterUse[0] ,
&printsetting.m_bFooterUse[1] ,
&printsetting.m_bFooterUse[2]
);
}
}else{
wsprintf( szKeyData, pszForm,
printsetting.m_nPrintFontWidth ,
printsetting.m_nPrintFontHeight ,
printsetting.m_nPrintDansuu ,
printsetting.m_nPrintDanSpace ,
printsetting.m_nPrintLineSpacing ,
printsetting.m_nPrintMarginTY ,
printsetting.m_nPrintMarginBY ,
printsetting.m_nPrintMarginLX ,
printsetting.m_nPrintMarginRX ,
printsetting.m_nPrintPaperOrientation ,
printsetting.m_nPrintPaperSize ,
printsetting.m_bPrintWordWrap ,
printsetting.m_bPrintLineNumber ,
printsetting.m_bHeaderUse[0] ,
printsetting.m_bHeaderUse[1] ,
printsetting.m_bHeaderUse[2] ,
printsetting.m_bFooterUse[0] ,
printsetting.m_bFooterUse[1] ,
printsetting.m_bFooterUse[2]
);
cProfile.IOProfileData( bRead, pszSecName, szKeyName, szKeyData, 0 );
}
wsprintf( szKeyName, "PS[%02d].szSName" , i );
cProfile.IOProfileData( bRead, pszSecName, szKeyName,
printsetting.m_szPrintSettingName ,
sizeof( m_pShareData->m_PrintSettingArr[0].m_szPrintSettingName ));
wsprintf( szKeyName, "PS[%02d].szFF" , i );
cProfile.IOProfileData( bRead, pszSecName, szKeyName,
printsetting.m_szPrintFontFaceHan ,
sizeof( m_pShareData->m_PrintSettingArr[0].m_szPrintFontFaceHan ));
wsprintf( szKeyName, "PS[%02d].szFFZ" , i );
cProfile.IOProfileData( bRead, pszSecName, szKeyName,
printsetting.m_szPrintFontFaceZen ,
sizeof( m_pShareData->m_PrintSettingArr[0].m_szPrintFontFaceZen ));
for( j = 0; j < 3; ++j ){
wsprintf( szKeyName, "PS[%02d].szHF[%d]" , i, j );
cProfile.IOProfileData( bRead, pszSecName, szKeyName,
printsetting.m_szHeaderForm[j],
sizeof( m_pShareData->m_PrintSettingArr[0].m_szHeaderForm [0] ));
wsprintf( szKeyName, "PS[%02d].szFTF[%d]", i, j );
cProfile.IOProfileData( bRead, pszSecName, szKeyName,
printsetting.m_szFooterForm[j],
sizeof( m_pShareData->m_PrintSettingArr[0].m_szFooterForm[0] ));
}
wsprintf( szKeyName, "PS[%02d].szDriver", i );
cProfile.IOProfileData( bRead, pszSecName, szKeyName,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -