How to integrate an image into the source tree
Rafael Dominguez
venccsralph at gmail.com
Mon Jun 18 12:22:41 PDT 2012
On Mon, Jun 18, 2012 at 2:38 PM, Cedric Bosdonnat <cbosdonnat at suse.com>wrote:
> On Mon, 2012-06-18 at 14:20 -0430, Rafael Dominguez wrote:
> > Im trying to use a picture in my dialog for a button, i added the
> > image (check.png) to icon-themes/galaxy/sfx2/res folder but when i
> > compile, i get an error msg
> > The image(s) <check> could not be found.
>
> Could you show a snippet of your code trying to load the image? It won't
> be easy to help you otherwise ;)
>
> --
> Cedric
>
>
/*
* Copyright 2012 LibreOffice contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "doc.hrc"
#include "templatedlg.hrc"
#include "helpid.hrc"
ModalDialog DLG_TEMPLATE_MANAGER
{
HelpId = CMD_SID_TEMPLATE_MANAGER;
OutputSize = TRUE;
SVLook = TRUE;
Moveable = TRUE;
Closeable = TRUE;
Hide = TRUE;
Size = MAP_APPFONT ( 290 , 250 );
Text [en-US] = "Template Manager";
PushButton BTN_SELECT_ALL
{
Pos = MAP_APPFONT(10,5);
Size = MAP_APPFONT(50,14);
TabStop = TRUE;
DefButton = TRUE;
Text [en-US] = "All";
};
PushButton BTN_SELECT_DOCS
{
Pos = MAP_APPFONT(60,5);
Size = MAP_APPFONT(50,14);
TabStop = TRUE;
Text [en-US] = "Documents";
};
PushButton BTN_SELECT_PRESENTATIONS
{
Pos = MAP_APPFONT(110,5);
Size = MAP_APPFONT(50,14);
TabStop = TRUE;
Text [en-US] = "Presentations";
};
PushButton BTN_SELECT_SHEETS
{
Pos = MAP_APPFONT(160,5);
Size = MAP_APPFONT(50,14);
TabStop = TRUE;
Text [en-US] = "Spreedsheets";
};
PushButton BTN_SELECT_DRAWS
{
Pos = MAP_APPFONT(210,5);
Size = MAP_APPFONT(50,14);
TabStop = TRUE;
Text [en-US] = "Drawings";
};
ImageButton BTN_SELECTION_MODE
{
Pos = MAP_APPFONT(265,5);
Size = MAP_APPFONT(14,14);
TabStop = TRUE;
ButtonImage = Image
{
ImageBitmap = Bitmap { File = "selection.png" ; };
};
};
Control TEMPLATE_VIEW
{
Pos = MAP_APPFONT(5,30);
Size = MAP_APPFONT(280,220);
TabStop = TRUE;
};
};
Dialog code, loading resources
SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
: ModalDialog(parent, SfxResId(DLG_TEMPLATE_MANAGER)),
aButtonAll(this,SfxResId(BTN_SELECT_ALL)),
aButtonDocs(this,SfxResId(BTN_SELECT_DOCS)),
aButtonPresents(this,SfxResId(BTN_SELECT_PRESENTATIONS)),
aButtonSheets(this,SfxResId(BTN_SELECT_SHEETS)),
aButtonDraws(this,SfxResId(BTN_SELECT_DRAWS)),
maButtonSelMode(this,SfxResId(BTN_SELECTION_MODE)),
maView(new ThumbnailView(this,SfxResId(TEMPLATE_VIEW)))
{
maButtonSelMode.SetStyle(maButtonSelMode.GetStyle() | WB_TOGGLE);
maView->SetStyle(WB_TABSTOP | WB_VSCROLL);
maView->SetColCount(MAX_COLUMN_COUNT);
maView->SetLineCount(MAX_LINE_COUNT);
aButtonAll.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewAllHdl));
aButtonDocs.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewDocsHdl));
maButtonSelMode.SetClickHdl(LINK(this,SfxTemplateManagerDlg,OnClickSelectionMode));
maView->Populate();
maView->Show();
FreeResource();
}
when i compile the code i get this error
[ build RES ] sfxen-US
S=/home/ralph/Proyectos/libreoffice/core && O=$S/solver/unxlngi6.pro &&
W=$S/workdir/unxlngi6.pro && mkdir -p $W/ResTarget/ $O/bin $W/ResTarget/
&& RESPONSEFILE=`mktemp -t gbuild.XXXXXX` && echo "-r -p -lgen-US
-fs=$W/ResTarget/sfxen-US.res -lip=$S/icon-themes/galaxy/sfx2/sfx
-lip=$S/icon-themes/galaxy/sfx2/imglst/en-US
-lip=$S/icon-themes/galaxy/sfx2/imglst
-lip=$S/icon-themes/galaxy/sfx2/res/en-US
-lip=$S/icon-themes/galaxy/sfx2/res -lip=$S/icon-themes/galaxy/sfx2
-lip=$S/icon-themes/galaxy/res/en-US -lip=$S/icon-themes/galaxy/res
-subMODULE=$S/icon-themes/galaxy/ -subGLOBALRES=$S/icon-themes/galaxy/res
-oil=$W/ResTarget/ $W/SrsTarget/sfx/res.srs" > ${RESPONSEFILE} &&
LD_LIBRARY_PATH="$O/lib" SOLARBINDIR=$O/bin $O/bin/rsc @${RESPONSEFILE} &&
rm -f ${RESPONSEFILE}
f268: Error: The image(s) <selection> could not be found.
Terminating compiler
make: *** [/home/ralph/Proyectos/libreoffice/core/workdir/
unxlngi6.pro/ResTarget/sfxen-US.res] Error 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120618/c26addf8/attachment.html>
More information about the LibreOffice
mailing list