Kaydet (Commit) 324e116a authored tarafından Caolán McNamara's avatar Caolán McNamara

add a stock index image to vcl, ala gtk-index

Change-Id: I96cd80f14d557752c19b88bb2c99298d7c3e3e0b
üst c578c327
......@@ -41,6 +41,7 @@
#define SV_RESID_BITMAP_SCROLLMSK 1050
#define SV_RESID_BITMAP_SCROLLBMP 1051
#define SV_RESID_BITMAP_CLOSEDOC 1052
#define SV_RESID_BITMAP_INDEX 1053
#define SV_DISCLOSURE_PLUS 1060
#define SV_DISCLOSURE_MINUS 1061
......
......@@ -77,6 +77,11 @@ Bitmap SV_RESID_BITMAP_CLOSEDOC
File = "closedoc.png";
};
Bitmap SV_RESID_BITMAP_INDEX
{
File = "index.png";
};
Bitmap SV_RESID_BITMAP_SPLITHPIN
{
File = "splhpin.png";
......
......@@ -33,6 +33,14 @@
namespace
{
sal_uInt16 mapStockToImageResource(OString sType)
{
sal_uInt16 nRet = 0;
if (sType == "gtk-index")
nRet = SV_RESID_BITMAP_INDEX;
return nRet;
}
SymbolType mapStockToSymbol(OString sType)
{
SymbolType eRet = SYMBOL_NOSYMBOL;
......@@ -54,6 +62,8 @@ namespace
eRet = SYMBOL_HELP;
else if (sType == "gtk-close")
eRet = SYMBOL_CLOSE;
else if (mapStockToImageResource(sType))
eRet = SYMBOL_IMAGE;
return eRet;
}
}
......@@ -168,13 +178,19 @@ VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OStri
PushButton *pTarget = get<PushButton>(aI->m_sID);
FixedImage *pImage = get<FixedImage>(aI->m_sValue);
aImagesToBeRemoved.insert(aI->m_sValue);
SymbolType eType = mapStockToSymbol(m_pParserState->m_aStockMap[aI->m_sValue]);
const OString &rImage = m_pParserState->m_aStockMap[aI->m_sValue];
SymbolType eType = mapStockToSymbol(rImage);
SAL_WARN_IF(!pTarget || !pImage || eType == SYMBOL_NOSYMBOL,
"vcl", "missing elements of button/image/stock");
if (!pTarget || eType == SYMBOL_NOSYMBOL)
continue;
//to-do, situation where image isn't a stock image
if (pTarget && eType != SYMBOL_NOSYMBOL)
{
pTarget->SetSymbol(eType);
if (eType == SYMBOL_IMAGE)
pTarget->SetModeImage(VclResId(mapStockToImageResource(rImage)));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment