本文整理汇总了C++中UT_Win32LocaleString类的典型用法代码示例。如果您正苦于以下问题:C++ UT_Win32LocaleString类的具体用法?C++ UT_Win32LocaleString怎么用?C++ UT_Win32LocaleString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UT_Win32LocaleString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UT_return_val_if_fail
int XAP_Win32DialogBase::addItemToCombo(UT_sint32 controlId, LPCSTR p_str)
{
UT_return_val_if_fail(IsWindow(m_hDlg), CB_ERR);
UT_Win32LocaleString str;
str.fromUTF8 (p_str);
return SendDlgItemMessageW(m_hDlg, controlId, CB_ADDSTRING, 0, (LPARAM)str.c_str());
}
示例2:
/* From UCS4 To WinLocale */
UT_Win32LocaleString AP_Win32App::s_fromUCS4ToWinLocale(const UT_UCS4Char * szIn)
{
UT_Win32LocaleString sRslt;
sRslt.fromUCS4(szIn);
//UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
return sRslt;
}
示例3: UT_return_if_fail
void XAP_Win32DialogBase::setDialogTitle(const char* uft8_str)
{
UT_return_if_fail(IsWindow(m_hDlg));
UT_Win32LocaleString str;
str.fromUTF8 (uft8_str);
SetWindowTextW (m_hDlg, str.c_str());
}
示例4: SendMessageW
void AP_Win32Dialog_Field::SetFieldsList(void)
{
fp_FieldTypesEnum FType = fp_FieldTypes[m_iTypeIndex].m_Type;
SendMessageW(m_hwndFormats, LB_RESETCONTENT, 0, 0);
int i;
for (i = 0;fp_FieldFmts[i].m_Tag != NULL;i++)
{
if( fp_FieldFmts[i].m_Type == FType )
break;
}
UT_Win32LocaleString str;
for (;fp_FieldFmts[i].m_Tag != NULL && fp_FieldFmts[i].m_Type == FType;i++)
{
if((fp_FieldFmts[i].m_Num != FPFIELD_endnote_anch) &&
(fp_FieldFmts[i].m_Num != FPFIELD_endnote_ref) &&
(fp_FieldFmts[i].m_Num != FPFIELD_footnote_anch) &&
(fp_FieldFmts[i].m_Num != FPFIELD_footnote_ref))
{
str.fromUTF8(fp_FieldFmts[i].m_Desc);
UT_sint32 index = SendMessageW(m_hwndFormats, LB_ADDSTRING, 0, (LPARAM)str.c_str());
if (index != LB_ERR && index != LB_ERRSPACE)
{
SendMessageW(m_hwndFormats, LB_SETITEMDATA, (WPARAM)index, (LPARAM)i);
}
}
}
SendMessageW(m_hwndFormats, LB_SETCURSEL, 0, 0);
_FormatListBoxChange();
}
示例5: CreatePen
/*
Draws the Format button with an arrow
*/
void AP_Win32Dialog_Styles::_onDrawButton(LPDRAWITEMSTRUCT lpDrawItemStruct, HWND hWnd)
{
UINT uiState = lpDrawItemStruct->itemState;
HPEN hPen;
HPEN pOldPen;
HDC hdc = lpDrawItemStruct->hDC;
int nWidth;
int nHeight;
int x, xEnd, xStart;
int y;
POINT p;
const char* pText;
HWND hParent;
LONG lData;
UT_Win32LocaleString str;
const XAP_StringSet * pSS = m_pApp->getStringSet();
pText= pSS->getValue(AP_STRING_ID_DLG_Styles_ModifyFormat);
nWidth = lpDrawItemStruct->rcItem.right - lpDrawItemStruct->rcItem.left;
nHeight = lpDrawItemStruct->rcItem.bottom - lpDrawItemStruct->rcItem.top;
// set the pen color
if (uiState&ODS_DISABLED)
hPen = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_GRAYTEXT));
else
hPen = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_BTNTEXT));
pOldPen = (HPEN) SelectObject(hdc, hPen);
// draw the border of the button
if(uiState&ODS_SELECTED)
DrawFrameControl(hdc, &lpDrawItemStruct->rcItem, DFC_BUTTON, DFCS_BUTTONPUSH|DFCS_PUSHED);
else
DrawFrameControl(hdc, &lpDrawItemStruct->rcItem, DFC_BUTTON, DFCS_BUTTONPUSH);
// Draw arrow
y = nHeight/2;
xStart = (nWidth/6)*5;
for (int i=0; i<4; i++)
{
x = xStart + i;
xEnd = xStart + 7 - i;
::MoveToEx(hdc, x, y, &p);
::LineTo(hdc, xEnd, y);
y++;
}
str.fromUTF8(pText);
ExtTextOutW(hdc, (nWidth/6)*1, ((nHeight/4)), 0, NULL, str.c_str(), str.length(), NULL);
// Clean Up
SelectObject(hdc, pOldPen);
DeleteObject(hPen);
}
示例6:
void XAP_Win32DialogBase::getComboTextItem(UT_sint32 controlId, int index, UT_Win32LocaleString& str)
{
UT_return_if_fail(IsWindow(m_hDlg));
wchar_t szBuff[1024];
if (SendDlgItemMessageW(m_hDlg, controlId, CB_GETLBTEXT, index, (LPARAM)szBuff) != CB_ERR)
str.fromLocale(szBuff);
else
str.clear();
}
示例7: getColumns
BOOL AP_Win32Dialog_Columns::_onDeltaPos(NM_UPDOWN * pnmud)
{
wchar_t buf[BUFSIZE];
UT_Win32LocaleString str;
switch( pnmud->hdr.idFrom )
{
case AP_RID_DIALOG_COLUMN_SPIN_NUMCOLUMNS:
if( pnmud->iDelta < 0 )
{
setColumns( getColumns() + 1 );
}
else
{
if( getColumns() > 1 )
{
setColumns( getColumns() - 1 );
}
}
SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_NUMCOLUMNS, _itow(getColumns(),buf,10));
checkButton(AP_RID_DIALOG_COLUMN_RADIO_ONE, (getColumns()==1));
checkButton(AP_RID_DIALOG_COLUMN_RADIO_TWO, (getColumns()==2));
checkButton(AP_RID_DIALOG_COLUMN_RADIO_THREE, (getColumns()==3));
return 1;
case AP_RID_DIALOG_COLUMN_SPIN_SPACEAFTER:
if( pnmud->iDelta < 0 )
{
incrementSpaceAfter( true );
}
else
{
incrementSpaceAfter( false );
}
str.fromUTF8 (getSpaceAfterString());
SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_SPACEAFTER, str.c_str ());
return 1;
case AP_RID_DIALOG_COLUMN_SPIN_MAXSIZE:
if( pnmud->iDelta < 0 )
{
incrementMaxHeight( true );
}
else
{
incrementMaxHeight( false );
}
str.fromUTF8 (getHeightString());
SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_MAXSIZE, str.c_str ());
return 1;
default:
return 0;
}
}
示例8:
void AP_Win32Dialog_Field::SetTypesList(void)
{
UT_Win32LocaleString str;
for (int i = 0;fp_FieldTypes[i].m_Desc != NULL;i++)
{
str.fromUTF8(fp_FieldTypes[i].m_Desc);
SendMessageW(m_hwndTypes, LB_ADDSTRING, (WPARAM)0, (LPARAM)str.c_str());
}
SendMessageW(m_hwndTypes, LB_SETCURSEL, (WPARAM)0, (LPARAM)0);
m_iTypeIndex = 0;
}
示例9: GetDlgItemTextW
bool XAP_Win32DialogBase::getDlgItemText(int nIDDlgItem, UT_Win32LocaleString& str)
{
wchar_t szBuff [1024];
bool rslt;
rslt = (bool) GetDlgItemTextW(m_hDlg, nIDDlgItem, szBuff, 1024);
if (rslt == true)
str.fromLocale(szBuff);
else
str.clear();
return rslt;
}
示例10: LoadCursor
bool AP_Win32LeftRuler::registerClass(XAP_Win32App * app)
{
ATOM a;
UT_Win32LocaleString str;
str.fromASCII (app->getApplicationName());
// register class for the left ruler
swprintf(s_LeftRulerWndClassName, L"%sLeftRuler", str.c_str());
a = UT_RegisterClassEx(CS_DBLCLKS | CS_OWNDC, AP_Win32LeftRuler::_LeftRulerWndProc, app->getInstance(),
NULL, LoadCursor(NULL, IDC_ARROW), GetSysColorBrush(COLOR_BTNFACE), NULL,
NULL, s_LeftRulerWndClassName);
UT_ASSERT_HARMLESS(a);
return true;
}
示例11: UT_return_val_if_fail
int CALLBACK AP_Win32Toolbar_FontCombo::_EnumFontsProc(LPLOGFONTW lplf,
LPTEXTMETRICW lptm,
DWORD dwStyle,
LONG lParam)
{
AP_Win32Toolbar_FontCombo * ctl = (AP_Win32Toolbar_FontCombo *) lParam;
UT_return_val_if_fail (ctl, 0);
/*
WARNING: any changes to this function should be closely coordinated
with the equivalent logic in Win32Graphics::FindFont()
*/
// filter out fonts we don't use
if (dwStyle & RASTER_FONTTYPE)
return 1 ;
#if 0
// This is too restrictive. Since EnumFontFamilies chooses at random
// the character set for the chosen font family, we were missing things
// here. Perhaps use EnumFontFamiliesEx instead?
if (lplf->lfCharSet != ANSI_CHARSET)
return 1 ;
#endif
// filter out vertical fonts which aren't supported
if (lplf->lfFaceName[0]=='@')
return 1;
UT_Win32LocaleString str;
str.fromLocale (lplf->lfFaceName);
char * p = g_strdup((str.utf8_str().utf8_str()));
if (seenFonts.find(p)!=seenFonts.end()) {
FREEP(p);
return 1;
}
ctl->m_vecContents.addItem(p);
ctl->m_vecFontCharSet.addItem((void*)lplf->lfCharSet);
seenFonts.insert(p);
return 1;
}
示例12: resetContent
void AP_Win32Dialog_MailMerge::setFieldList()
{
if (!m_vecFields.size())
return;
resetContent(AP_RID_DIALOG_MAILMERGE_LISTBOX);
// build a list of all items
for (UT_sint32 i = 0; i < m_vecFields.size(); i++)
{
UT_continue_if_fail(m_vecFields[i]);
UT_Win32LocaleString str;
str.fromUTF8(((UT_UTF8String*)m_vecFields[i])->utf8_str());
SendMessageW(GetDlgItem(m_hDlg, AP_RID_DIALOG_MAILMERGE_LISTBOX), LB_ADDSTRING,
0, (LPARAM)str.ucs2_str());
}
}
示例13: s_createDirectoryIfNecessary
static bool s_createDirectoryIfNecessary(const char * szDir)
{
struct _stat statbuf;
UT_Win32LocaleString str;
str.fromUTF8(szDir);
if (_wstat(str.c_str(),&statbuf) == 0) // if it exists
{
if ( (statbuf.st_mode & _S_IFDIR) == _S_IFDIR ) // and is a directory
return true;
UT_DEBUGMSG(("Pathname [%s] is not a directory.\n",szDir));
return false;
}
if (CreateDirectoryW(str.c_str(),NULL))
return true;
UT_DEBUGMSG(("Could not create Directory [%s].\n",szDir));
return false;
}
示例14: UT_return_if_fail
void AP_Win32Dialog_CollaborationAccounts::_populateWindowData()
{
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
UT_return_if_fail(pManager);
m_bPopulating = true;
// clear out the old contents, if any
ListView_DeleteAllItems(m_hAccountList);
for (UT_uint32 i = 0; i < pManager->getAccounts().size(); i++)
{
AccountHandler* pAccount = pManager->getAccounts()[i];
UT_continue_if_fail(pAccount);
UT_Win32LocaleString sAccountText = AP_Win32App::s_fromUTF8ToWinLocale(pAccount->getDescription().utf8_str());
UT_Win32LocaleString sAccountTypeText = AP_Win32App::s_fromUTF8ToWinLocale(pAccount->getDisplayType().utf8_str());
// insert a new account record
LVITEMW lviAccount;
lviAccount.mask = LVIF_STATE | LVIF_IMAGE | LVIF_PARAM;
lviAccount.state = 1;
lviAccount.iItem = i;
lviAccount.iSubItem = 0;
lviAccount.lParam = (LPARAM)pAccount;
SendMessageW(m_hAccountList, LVM_INSERTITEMW, 0, (LPARAM) &lviAccount);
ListView_SetCheckState(m_hAccountList, i, pAccount->isOnline());
lviAccount.iSubItem=1;
lviAccount.pszText= const_cast<LPWSTR>(sAccountText.c_str());
SendMessageW(m_hAccountList, LVM_SETITEMTEXTW, i, (LPARAM) &lviAccount);
lviAccount.iSubItem=2;
lviAccount.pszText= const_cast<LPWSTR>(sAccountTypeText.c_str());
SendMessageW(m_hAccountList, LVM_SETITEMTEXTW, i, (LPARAM) &lviAccount);
}
_updateSelection();
m_bPopulating = false;
}
示例15: UT_return_val_if_fail
/*
Does a stringSet exist on disk?
*/
bool AP_Win32App::doesStringSetExist(const char* pLocale)
{
HANDLE in;
const char * szDirectory = NULL;
UT_return_val_if_fail(pLocale, false);
getPrefsValueDirectory(true,AP_PREF_KEY_StringSetDirectory,&szDirectory);
UT_return_val_if_fail(((szDirectory) && (*szDirectory)), false);
char *szPathname = (char*) UT_calloc(sizeof(char),strlen(szDirectory)+strlen(pLocale)+100);
UT_return_val_if_fail(szPathname, false);
char *szDest = szPathname;
strcpy(szDest, szDirectory);
szDest += strlen(szDest);
if ((szDest > szPathname) && (szDest[-1]!='\\'))
*szDest++='\\';
lstrcpyA(szDest,pLocale);
lstrcatA(szDest,".strings");
UT_Win32LocaleString wsFilename;
wsFilename.fromUTF8(szPathname);
in = CreateFileW(wsFilename.c_str(),0,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,
OPEN_EXISTING,0,NULL);
g_free (szPathname);
if (in!=INVALID_HANDLE_VALUE)
{
CloseHandle(in);
return true;
}
return false;
}