Kaydet (Commit) 876fdf01 authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Convert bitmap tab page to widget UI

Change-Id: I5633a5e96582f94b9619152805cfa13daeb3fe53
Reviewed-on: https://gerrit.libreoffice.org/5162Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst a0709e32
......@@ -17,6 +17,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/asiantypography \
cui/uiconfig/ui/autocorrectdialog \
cui/uiconfig/ui/backgroundpage \
cui/uiconfig/ui/bitmaptabpage \
cui/uiconfig/ui/borderpage \
cui/uiconfig/ui/cellalignment \
cui/uiconfig/ui/charnamepage \
......
......@@ -522,24 +522,21 @@ class SvxBitmapTabPage : public SvxTabPage
using TabPage::DeactivatePage;
private:
SvxPixelCtl aCtlPixel;
FixedText aFtPixelEdit;
FixedText aFtColor;
ColorLB aLbColor;
FixedText aFtBackgroundColor;
ColorLB aLbBackgroundColor;
FixedText aLbBitmapsHidden;
BitmapLB aLbBitmaps;
FixedLine aFlProp;
SvxXRectPreview aCtlPreview;
PushButton aBtnAdd;
PushButton aBtnModify;
PushButton aBtnImport;
PushButton aBtnDelete;
ImageButton aBtnLoad;
ImageButton aBtnSave;
SvxBitmapCtl aBitmapCtl;
VclBox* m_pBxPixelEditor;
SvxPixelCtl* m_pCtlPixel;
ColorLB* m_pLbColor;
ColorLB* m_pLbBackgroundColor;
FixedText* m_pLbBitmapsHidden;
BitmapLB* m_pLbBitmaps;
SvxXRectPreview* m_pCtlPreview;
PushButton* m_pBtnAdd;
PushButton* m_pBtnModify;
PushButton* m_pBtnImport;
PushButton* m_pBtnDelete;
PushButton* m_pBtnLoad;
PushButton* m_pBtnSave;
SvxBitmapCtl* m_pBitmapCtl;
const SfxItemSet& rOutAttrs;
......@@ -575,6 +572,7 @@ private:
public:
SvxBitmapTabPage( Window* pParent, const SfxItemSet& rInAttrs );
~SvxBitmapTabPage();
void Construct();
......
......@@ -246,7 +246,6 @@
#define HID_MEASURE_CTL_PREVIEW "CUI_HID_MEASURE_CTL_PREVIEW"
#define HID_SVXPAGE_SWPOSSIZE "CUI_HID_SVXPAGE_SWPOSSIZE"
#define HID_AREA_BITMAP "CUI_HID_AREA_BITMAP"
#define HID_TPSHADOW_CTRL "CUI_HID_TPSHADOW_CTRL"
#define HID_LINE_ENDDEF "CUI_HID_LINE_ENDDEF"
#define HID_LINE_LINE "CUI_HID_LINE_LINE"
......
......@@ -28,155 +28,6 @@
#define TRANS_GRAD_OFFSET_X 6
#define TRANS_GRAD_OFFSET_Y 64
// ------------------------------------------------------
TabPage RID_SVXPAGE_BITMAP
{
HelpID = HID_AREA_BITMAP ;
Hide = TRUE ;
Text [ en-US ] = "Bitmap Patterns" ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedLine FL_PROP
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 248, 8 ) ;
Text [ en-US ] = "Properties";
};
FixedText FT_PIXEL_EDIT
{
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 85 , 8 ) ;
Text [ en-US ] = "Pattern Editor";
};
Control CTL_PIXEL
{
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 25 ) ;
Size = MAP_APPFONT ( 72 , 72 ) ;
TabStop = TRUE ;
};
FixedText FT_COLOR
{
Pos = MAP_APPFONT ( 12 , 104 ) ;
Size = MAP_APPFONT ( 85 , 8 ) ;
Text [ en-US ] = "~Foreground color";
};
ListBox LB_COLOR
{
HelpID = "cui:ListBox:RID_SVXPAGE_BITMAP:LB_COLOR";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 115 ) ;
Size = MAP_APPFONT ( 62 , 100 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
DDExtraWidth = TRUE ;
};
FixedText FT_BACKGROUND_COLOR
{
Pos = MAP_APPFONT ( 12 , 131 ) ;
Size = MAP_APPFONT ( 85 , 8 ) ;
Text [ en-US ] = "~Background color";
};
ListBox LB_BACKGROUND_COLOR
{
HelpID = "cui:ListBox:RID_SVXPAGE_BITMAP:LB_BACKGROUND_COLOR";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 142 ) ;
Size = MAP_APPFONT ( 62 , 100 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
DDExtraWidth = TRUE ;
};
FixedText FT_BITMAPS_HIDDEN
{
// Hidden label that provides the name for the bitmaps list box.
Text [ en-US ] = "Bitmap";
};
ListBox LB_BITMAPS
{
HelpID = "cui:ListBox:RID_SVXPAGE_BITMAP:LB_BITMAPS";
Border = TRUE ;
Pos = MAP_APPFONT ( 103 , 14 ) ;
Size = MAP_APPFONT ( 88 , 110 ) ;
TabStop = TRUE ;
};
Control CTL_PREVIEW
{
Border = TRUE ;
Pos = MAP_APPFONT ( 103 , 131 ) ;
Size = MAP_APPFONT ( 88 , 42 ) ;
};
PushButton BTN_ADD
{
HelpID = "cui:PushButton:RID_SVXPAGE_BITMAP:BTN_ADD";
Pos = MAP_APPFONT ( 197 , 14 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Add..." ;
TabStop = TRUE ;
};
PushButton BTN_MODIFY
{
HelpID = "cui:PushButton:RID_SVXPAGE_BITMAP:BTN_MODIFY";
Pos = MAP_APPFONT ( 197 , 32 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Modify..." ;
TabStop = TRUE ;
};
PushButton BTN_IMPORT
{
HelpID = "cui:PushButton:RID_SVXPAGE_BITMAP:BTN_IMPORT";
Pos = MAP_APPFONT ( 197 , 50 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Import..." ;
TabStop = TRUE ;
};
PushButton BTN_DELETE
{
HelpID = "cui:PushButton:RID_SVXPAGE_BITMAP:BTN_DELETE";
Pos = MAP_APPFONT ( 197 , 68 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Delete..." ;
TabStop = TRUE ;
};
ImageButton BTN_LOAD
{
HelpID = "cui:ImageButton:RID_SVXPAGE_BITMAP:BTN_LOAD";
Pos = MAP_APPFONT ( 197 , 104 ) ;
Size = MAP_APPFONT ( 16 , 16 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Load Bitmap List";
ButtonImage = Image
{
ImageBitmap = Bitmap
{
File = "sc05501.bmp" ;
};
};
};
ImageButton BTN_SAVE
{
HelpID = "cui:ImageButton:RID_SVXPAGE_BITMAP:BTN_SAVE";
Pos = MAP_APPFONT ( 217 , 104 ) ;
Size = MAP_APPFONT ( 16 , 16 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Save Bitmap List";
ButtonImage = Image
{
ImageBitmap = Bitmap
{
File = "sc05502.bmp" ;
};
};
};
CheckBox BTN_EMBED
{
HelpID = "cui:ImageButton:RID_SVXPAGE_BITMAP:BTN_EMBED";
Pos = MAP_APPFONT ( 197 , 124 ) ;
Size = MAP_APPFONT ( 122 , 10 ) ;
Text [ en-US ] = "Embed";
};
};
// ------------------------------------------------------
TabDialog RID_SVXDLG_AREA
{
......
This diff is collapsed.
......@@ -221,6 +221,9 @@
<glade-widget-class title="Shadow Preview" name="svxlo-SvxXShadowPreview"
generic-name="Shadow Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Bitmap Pixel Editor" name="svxlo-SvxPixelCtl"
generic-name="Bitmap Pixel Editor" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Frame Selector" name="svxlo-SvxFrameSelector"
generic-name="Frame Border Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
......
......@@ -140,7 +140,7 @@ class SVX_DLLPUBLIC SvxBitmapCtl
{
protected:
Size aSize;
sal_uInt16 nLines;
sal_uInt16 nLines;
Color aPixelColor, aBackgroundColor;
const sal_uInt16* pBmpArray;
......@@ -177,8 +177,9 @@ protected:
void ChangePixel( sal_uInt16 nPixel );
public:
SvxPixelCtl( Window* pParent, const ResId& rResId,
sal_uInt16 nNumber = 8 );
SvxPixelCtl( Window* pParent, const ResId& rResId, sal_uInt16 nNumber = 8 );
SvxPixelCtl( Window* pParent, sal_uInt16 nNumber = 8 );
~SvxPixelCtl();
virtual void Paint( const Rectangle& rRect );
......
......@@ -766,6 +766,27 @@ SvxPixelCtl::SvxPixelCtl( Window* pParent, const ResId& rResId, sal_uInt16 nNumb
memset(pPixel, 0, nSquares * sizeof(sal_uInt16));
}
SvxPixelCtl::SvxPixelCtl( Window* pParent, sal_uInt16 nNumber ) :
Control ( pParent, WB_BORDER ),
nLines ( nNumber ),
bPaintable ( sal_True )
{
//aRectSize = GetOutputSize();
aRectSize = LogicToPixel(Size(72, 72), MAP_APPFONT);
SetPixelColor( Color( COL_BLACK ) );
SetBackgroundColor( Color( COL_WHITE ) );
SetLineColor( Application::GetSettings().GetStyleSettings().GetShadowColor() );
nSquares = nLines * nLines;
pPixel = new sal_uInt16[ nSquares ];
memset(pPixel, 0, nSquares * sizeof(sal_uInt16));
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxPixelCtl(Window *pParent, sal_uInt16 nNumber)
{
return new SvxPixelCtl(pParent, 8 ); //nNumber);
}
// Destructor dealocating the dynamic array
SvxPixelCtl::~SvxPixelCtl( )
......
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