void
TableMakerAdvProperties::InitTableTypeValues()
{
    HWND        hwndcombo;
    wyInt32     index;
    wyString    strengine;
    wyWChar     *enginebuff, *tokpointer;

    GetTableEngineString(m_tunnel, m_mysql, strengine);

    enginebuff = AllocateBuffWChar(strengine.GetLength()+1);
    wcscpy(enginebuff, strengine.GetAsWideChar());
    VERIFY(hwndcombo = GetDlgItem(m_hwnd, IDC_TYPE));

    tokpointer = wcstok(enginebuff, L";");

    while(tokpointer != NULL)
    {
        VERIFY((SendMessage(hwndcombo, CB_ADDSTRING, 0, (LPARAM)tokpointer)) >= 0);

        tokpointer = wcstok(NULL, L";");
    }
    free(enginebuff);

    if((index = SendMessage(hwndcombo , CB_ADDSTRING, 0,(LPARAM)TEXT(STR_DEFAULT))) != CB_ERR)
        SendMessage(hwndcombo, CB_SELECTSTRING, index, (LPARAM)TEXT(STR_DEFAULT));

    return;
}
Beispiel #2
0
wyWChar*
BlobMgmt::AnsitoUcs2(const wyChar *ansistr, wyInt32 len)
{
	wyInt32 length = MultiByteToWideChar(CP_ACP, 0, ansistr, len, NULL, NULL );
	wyWChar *ucs2str = NULL;

	ucs2str = AllocateBuffWChar(length + 1);
	MultiByteToWideChar(CP_ACP, 0, ansistr, -1, ucs2str, length);
	ucs2str[length] = 0;

	return ucs2str;
}
Beispiel #3
0
wyWChar*
BlobMgmt::Utf8toUcs2(const wyChar *utf8str, wyInt32 len)
{
	wyWChar	*ucs2str = NULL;
	wyInt32 length = MultiByteToWideChar(CP_UTF8, 0, utf8str, len, NULL, NULL );

	ucs2str = AllocateBuffWChar(length + 1);
	MultiByteToWideChar(CP_UTF8, 0, utf8str, -1, ucs2str, length);
	ucs2str[length] = 0;

	return ucs2str;
}
Beispiel #4
0
void 
BlobMgmt::OnComboChange()
{
	wyWChar		*buff = NULL;
	wyString	buffstr;
	wyInt32	length, ret, ncursel;
	
	ncursel = SendMessage(m_hwndcombo, CB_GETCURSEL, 0, 0);
	length  = SendMessage(m_hwndcombo, CB_GETLBTEXTLEN, NULL, NULL);
	buff    = AllocateBuffWChar(15+ 1);
	VERIFY(ret = SendMessage(m_hwndcombo, CB_GETLBTEXT,(WPARAM)ncursel,(LPARAM)buff) != CB_ERR);
	
	m_isencodingchanged = wyTrue;
	m_changedcombotext.SetAs(buff);
	free(buff);
}
Beispiel #5
0
void	
BlobMgmt::ShowBlobSize(wyInt32 datasize)
{
	wyString	strnumber ;
	//XFormat
	NUMBERFMT	nf;
	wyInt32		nsize;
	wyWChar		*formattednumber;
	wyString	str;

	strnumber.Sprintf("%d", datasize);
	memset(&nf, 0, sizeof(nf));
	
	nf.lpThousandSep = L",";
	nf.lpDecimalSep = L".";
	nf.LeadingZero = 1;
	nf.Grouping = 3;
	nf.NegativeOrder = 1;

	//string length + noof commas + 1 
	nsize = strnumber.GetLength() + strnumber.GetLength()/3 + 1;
	formattednumber = AllocateBuffWChar(nsize);

	if (GetNumberFormat(LOCALE_USER_DEFAULT, 
						0, 
						(LPCWSTR)strnumber.GetAsWideChar(), 
						&nf, 
						formattednumber, 
						nsize))
	{
		strnumber.SetAs(formattednumber);
	}

	//adding "bytes" 
	strnumber.AddSprintf(" bytes");
   		
	SendMessage(GetDlgItem(m_hwnddlg, IDC_BLOBSIZE ), WM_SETTEXT, strnumber.GetLength(), (LPARAM) strnumber.GetAsWideChar());

	if(formattednumber)
		free(formattednumber);
}
Beispiel #6
0
// function to process file type Favorite//
wyBool
FavoriteBase::AddFile(HMENU hmenu, wyString &parentpath,  wyWChar *filename)
{
	wyInt32				i , j=0;
	wyUInt32			lengthwchar = 1;
	wyWChar				ext[_MAX_EXT] = {0} , *data = {0};
	wyChar				*path = {0};
	MENUITEMINFO		lpmii={0};
	
	parentpath.GetAsWideChar(&lengthwchar);
	
	path = AllocateBuff(parentpath.GetLength() + 2);
	data = AllocateBuffWChar(wcslen(filename) + 2);

	wcscpy(data, (wyWChar*)filename);
	strcpy(path, (wyChar*)parentpath.GetString());

	for(i = wcslen(data) - 1; i && data[i]!='.'; i--, j++)
		ext[j] = data[i];
	
	if(wcsnicmp(ext, L"lqs", 3) != 0)
		return wyFalse;

	ext[j] = 0;
	data[i] = 0;
	
	lpmii.cbSize		= sizeof(MENUITEMINFO);
	lpmii.fMask			= MIIM_STRING|MIIM_ID|MIIM_DATA;
	lpmii.wID			= m_menuid++;
	lpmii.dwItemData	= (ULONG_PTR)path;
	lpmii.cch			= wcslen(data);
	lpmii.dwTypeData	= data;
	
    VERIFY(::InsertMenuItem(hmenu, -1, TRUE, &lpmii));

	free(data);

    return wyTrue;
}
void
TableMakerAdvProperties::HandleTabCharset(HWND hwnd)
{
    HWND        hwndcombo;
    wyInt32     ncursel, length, index;
    wyWChar     *charsetname = NULL;

    hwndcombo = GetDlgItem(hwnd, IDC_TABCHARSET);
    ncursel = SendMessage(hwndcombo, CB_GETCURSEL, 0, 0);
    length  = SendMessage(hwndcombo, CB_GETLBTEXTLEN, ncursel, NULL);

    charsetname    = AllocateBuffWChar(length + 1);

    SendMessage(hwndcombo, CB_GETLBTEXT,(WPARAM)ncursel,(LPARAM)charsetname);

    if(wcsicmp(charsetname, TEXT(STR_DEFAULT)) != 0)
        this->ReInitRelatedCollations(hwnd, charsetname);

    if((index = SendMessage(hwndcombo, CB_FINDSTRINGEXACT, -1, (LPARAM)TEXT(STR_DEFAULT))) == CB_ERR)
        SendMessage(hwndcombo, CB_ADDSTRING, 0, (LPARAM)TEXT(STR_DEFAULT));

    free(charsetname);
}