Patch level : 10.0
Files correlati : xvaga.dll Ricompilazione Demo : [ ] Commento : Gestita icona OEM negli alberi git-svn-id: svn://10.65.10.50/trunk@18055 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
17fa8fd7a3
commit
70cb4f16f8
@ -224,6 +224,24 @@ wxString _GetResourceName(const char* type, int rid)
|
||||
wxString strName(type); strName << "s";
|
||||
wxString strKey; strKey.Printf("%d", rid);
|
||||
|
||||
if ((rid == ICON_RSRC || rid == 0) && strName == "Icons")
|
||||
{
|
||||
wxString strFileName = _startup_dir + "/setup/oem.ini";
|
||||
const int oem = xvt_sys_get_profile_int(strFileName, "MAIN", "OEM", -1);
|
||||
if (oem >= 0)
|
||||
{
|
||||
wxString strPara; strPara << "OEM_" << oem;
|
||||
char name[MAX_PATH];
|
||||
xvt_sys_get_profile_string(strFileName, strPara, "Icon", "", name, sizeof(name));
|
||||
if (*name)
|
||||
{
|
||||
strFileName = _startup_dir + "/setup/" + name;
|
||||
if (wxFileExists(strFileName))
|
||||
return strFileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxString val;
|
||||
char* buff = val.GetWriteBuf(MAX_PATH);
|
||||
xvt_sys_get_profile_string(GetResourceIni(), strName, strKey, "", buff, MAX_PATH);
|
||||
@ -249,30 +267,11 @@ wxString _GetResourceName(const char* type, int rid)
|
||||
static wxIcon* _GetDefaultIcon()
|
||||
{
|
||||
wxIcon* icon = NULL;
|
||||
wxString strName = _startup_dir + "/setup/oem.ini";
|
||||
|
||||
const int oem = xvt_sys_get_profile_int(strName, "MAIN", "OEM", -1);
|
||||
if (oem >= 0)
|
||||
{
|
||||
wxString strPara; strPara << "OEM_" << oem;
|
||||
char name[MAX_PATH];
|
||||
xvt_sys_get_profile_string(strName, strPara, "Icon", "", name, sizeof(name));
|
||||
if (*name)
|
||||
{
|
||||
strName = _startup_dir + "/setup/" + name;
|
||||
if (wxFileExists(strName))
|
||||
icon = new wxIcon(strName, wxBITMAP_TYPE_ICO);
|
||||
}
|
||||
}
|
||||
|
||||
if (icon == NULL)
|
||||
{
|
||||
strName = _GetResourceName("Icon", ICON_RSRC);
|
||||
if (::wxFileExists(strName))
|
||||
icon = new wxIcon(strName, wxBITMAP_TYPE_ICO);
|
||||
}
|
||||
|
||||
if (icon == NULL)
|
||||
|
||||
wxString strName = _GetResourceName("Icon", ICON_RSRC);
|
||||
if (::wxFileExists(strName))
|
||||
icon = new wxIcon(strName, wxBITMAP_TYPE_ICO);
|
||||
else
|
||||
{
|
||||
strName.Printf("%d", ICON_RSRC);
|
||||
icon = new wxIcon(strName, wxBITMAP_TYPE_ICO_RESOURCE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user