summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r--svx/source/tbxctrls/layctrl.cxx81
-rw-r--r--svx/source/tbxctrls/tbcontrl.src2
-rw-r--r--svx/source/tbxctrls/tbunocontroller.cxx2
3 files changed, 48 insertions, 37 deletions
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index f004fe310e1d..2c2b1e2e7f41 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -43,18 +43,6 @@ SFX_IMPL_TOOLBOX_CONTROL(SvxColumnsToolBoxControl,SfxUInt16Item);
// class TableWindow -----------------------------------------------------
-const long TABLE_CELL_WIDTH = 15;
-const long TABLE_CELL_HEIGHT = 15;
-
-const long TABLE_CELLS_HORIZ = 10;
-const long TABLE_CELLS_VERT = 15;
-
-const long TABLE_POS_X = 2;
-const long TABLE_POS_Y = 2;
-
-const long TABLE_WIDTH = TABLE_POS_X + TABLE_CELLS_HORIZ*TABLE_CELL_WIDTH;
-const long TABLE_HEIGHT = TABLE_POS_Y + TABLE_CELLS_VERT*TABLE_CELL_HEIGHT;
-
class TableWindow : public SfxPopupWindow
{
private:
@@ -71,6 +59,18 @@ private:
Reference< XFrame > mxFrame;
OUString maCommand;
+ static const long TABLE_CELLS_HORIZ;
+ static const long TABLE_CELLS_VERT;
+
+ long mnTableCellWidth;
+ long mnTableCellHeight;
+
+ long mnTablePosX;
+ long mnTablePosY;
+
+ long mnTableWidth;
+ long mnTableHeight;
+
DECL_LINK( SelectHdl, void * );
public:
@@ -94,6 +94,9 @@ private:
void CloseAndShowTableDialog();
};
+const long TableWindow::TABLE_CELLS_HORIZ = 10;
+const long TableWindow::TABLE_CELLS_VERT = 15;
+
// -----------------------------------------------------------------------
IMPL_LINK_NOARG(TableWindow, SelectHdl)
@@ -111,8 +114,16 @@ TableWindow::TableWindow( sal_uInt16 nSlotId, const OUString& rCmd, const OUStri
nLine( 0 ),
rTbx(rParentTbx),
mxFrame( rFrame ),
- maCommand( rCmd )
+ maCommand( rCmd ),
+ mnTablePosX(2),
+ mnTablePosY(2)
{
+ mnTableCellWidth = 15 * GetDPIScaleFactor();
+ mnTableCellHeight = 15 * GetDPIScaleFactor();
+
+ mnTableWidth = mnTablePosX + TABLE_CELLS_HORIZ*mnTableCellWidth;
+ mnTableHeight = mnTablePosY + TABLE_CELLS_VERT*mnTableCellHeight;
+
const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
svtools::ColorConfig aColorConfig;
@@ -130,13 +141,13 @@ TableWindow::TableWindow( sal_uInt16 nSlotId, const OUString& rCmd, const OUStri
SetText( rText );
- aTableButton.SetPosSizePixel( Point( TABLE_POS_X + TABLE_CELL_WIDTH, TABLE_HEIGHT + 5 ),
- Size( TABLE_WIDTH - TABLE_POS_X - 2*TABLE_CELL_WIDTH, 24 ) );
+ aTableButton.SetPosSizePixel( Point( mnTablePosX + mnTableCellWidth, mnTableHeight + 5 ),
+ Size( mnTableWidth - mnTablePosX - 2*mnTableCellWidth, 24 ) );
aTableButton.SetText( SVX_RESSTR( RID_SVXSTR_MORE ) );
aTableButton.SetClickHdl( LINK( this, TableWindow, SelectHdl ) );
aTableButton.Show();
- SetOutputSizePixel( Size( TABLE_WIDTH + 3, TABLE_HEIGHT + 33 ) );
+ SetOutputSizePixel( Size( mnTableWidth + 3, mnTableHeight + 33 ) );
}
// -----------------------------------------------------------------------
@@ -160,8 +171,8 @@ void TableWindow::MouseMove( const MouseEvent& rMEvt )
Point aPos = rMEvt.GetPosPixel();
Point aMousePos( aPos );
- long nNewCol = ( aMousePos.X() - TABLE_POS_X + TABLE_CELL_WIDTH ) / TABLE_CELL_WIDTH;
- long nNewLine = ( aMousePos.Y() - TABLE_POS_Y + TABLE_CELL_HEIGHT ) / TABLE_CELL_HEIGHT;
+ long nNewCol = ( aMousePos.X() - mnTablePosX + mnTableCellWidth ) / mnTableCellWidth;
+ long nNewLine = ( aMousePos.Y() - mnTablePosY + mnTableCellHeight ) / mnTableCellHeight;
Update( nNewCol, nNewLine );
}
@@ -252,33 +263,33 @@ void TableWindow::MouseButtonUp( const MouseEvent& rMEvt )
void TableWindow::Paint( const Rectangle& )
{
- const long nSelectionWidth = TABLE_POS_X + nCol*TABLE_CELL_WIDTH;
- const long nSelectionHeight = TABLE_POS_Y + nLine*TABLE_CELL_HEIGHT;
+ const long nSelectionWidth = mnTablePosX + nCol*mnTableCellWidth;
+ const long nSelectionHeight = mnTablePosY + nLine*mnTableCellHeight;
// the non-selected parts of the table
SetLineColor( aLineColor );
SetFillColor( aFillColor );
- DrawRect( Rectangle( nSelectionWidth, TABLE_POS_Y, TABLE_WIDTH, nSelectionHeight ) );
- DrawRect( Rectangle( TABLE_POS_X, nSelectionHeight, nSelectionWidth, TABLE_HEIGHT ) );
- DrawRect( Rectangle( nSelectionWidth, nSelectionHeight, TABLE_WIDTH, TABLE_HEIGHT ) );
+ DrawRect( Rectangle( nSelectionWidth, mnTablePosY, mnTableWidth, nSelectionHeight ) );
+ DrawRect( Rectangle( mnTablePosX, nSelectionHeight, nSelectionWidth, mnTableHeight ) );
+ DrawRect( Rectangle( nSelectionWidth, nSelectionHeight, mnTableWidth, mnTableHeight ) );
// the selection
if ( nCol > 0 && nLine > 0 )
{
SetFillColor( aHighlightFillColor );
- DrawRect( Rectangle( TABLE_POS_X, TABLE_POS_Y,
+ DrawRect( Rectangle( mnTablePosX, mnTablePosY,
nSelectionWidth, nSelectionHeight ) );
}
// lines inside of the table
SetLineColor( aLineColor );
for ( long i = 1; i < TABLE_CELLS_VERT; ++i )
- DrawLine( Point( TABLE_POS_X, TABLE_POS_Y + i*TABLE_CELL_HEIGHT ),
- Point( TABLE_WIDTH, TABLE_POS_Y + i*TABLE_CELL_HEIGHT ) );
+ DrawLine( Point( mnTablePosX, mnTablePosY + i*mnTableCellHeight ),
+ Point( mnTableWidth, mnTablePosY + i*mnTableCellHeight ) );
for ( long i = 1; i < TABLE_CELLS_HORIZ; ++i )
- DrawLine( Point( TABLE_POS_X + i*TABLE_CELL_WIDTH, TABLE_POS_Y ),
- Point( TABLE_POS_X + i*TABLE_CELL_WIDTH, TABLE_HEIGHT ) );
+ DrawLine( Point( mnTablePosX + i*mnTableCellWidth, mnTablePosY ),
+ Point( mnTablePosX + i*mnTableCellWidth, mnTableHeight ) );
// the text near the mouse cursor telling the table dimensions
if ( nCol && nLine )
@@ -295,15 +306,15 @@ void TableWindow::Paint( const Rectangle& )
Size aTextSize( GetTextWidth( aText ), GetTextHeight() );
- long nTextX = nSelectionWidth + TABLE_CELL_WIDTH;
- long nTextY = nSelectionHeight + TABLE_CELL_HEIGHT;
+ long nTextX = nSelectionWidth + mnTableCellWidth;
+ long nTextY = nSelectionHeight + mnTableCellHeight;
const long nTipBorder = 2;
- if ( aTextSize.Width() + TABLE_POS_X + TABLE_CELL_WIDTH + 2*nTipBorder < nSelectionWidth )
- nTextX = nSelectionWidth - TABLE_CELL_WIDTH - aTextSize.Width();
+ if ( aTextSize.Width() + mnTablePosX + mnTableCellWidth + 2*nTipBorder < nSelectionWidth )
+ nTextX = nSelectionWidth - mnTableCellWidth - aTextSize.Width();
- if ( aTextSize.Height() + TABLE_POS_Y + TABLE_CELL_HEIGHT + 2*nTipBorder < nSelectionHeight )
- nTextY = nSelectionHeight - TABLE_CELL_HEIGHT - aTextSize.Height();
+ if ( aTextSize.Height() + mnTablePosY + mnTableCellHeight + 2*nTipBorder < nSelectionHeight )
+ nTextY = nSelectionHeight - mnTableCellHeight - aTextSize.Height();
SetLineColor( aLineColor );
SetFillColor( aBackgroundColor );
@@ -350,7 +361,7 @@ void TableWindow::Update( long nNewCol, long nNewLine )
{
nCol = nNewCol;
nLine = nNewLine;
- Invalidate( Rectangle( TABLE_POS_X, TABLE_POS_Y, TABLE_WIDTH, TABLE_HEIGHT ) );
+ Invalidate( Rectangle( mnTablePosX, mnTablePosY, mnTableWidth, mnTableHeight ) );
}
}
diff --git a/svx/source/tbxctrls/tbcontrl.src b/svx/source/tbxctrls/tbcontrl.src
index 4d2cfbc13a73..665f0fa5c2af 100644
--- a/svx/source/tbxctrls/tbcontrl.src
+++ b/svx/source/tbxctrls/tbcontrl.src
@@ -74,7 +74,7 @@ String RID_SVXSTR_FRAME_COLOR
ComboBox RID_SVXTBX_STYLE
{
HelpId = HID_STYLE_LISTBOX ;
- Size = MAP_APPFONT ( 67 , 86 ) ;
+ Size = MAP_APPFONT ( 50 , 86 ) ;
DropDown = TRUE ;
Sort = TRUE ;
AutoHScroll = TRUE ;
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index 36e257e5d876..c34384466b6e 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -85,7 +85,7 @@ SvxFontSizeBox_Impl::SvxFontSizeBox_Impl(
FontSizeBox( _pParent, WinBits( WB_DROPDOWN ) ),
m_pCtrl ( &_rCtrl ),
- m_aLogicalSize ( 30,100 ),
+ m_aLogicalSize ( 20,100 ),
m_bRelease ( true ),
m_xDispatchProvider ( _rDispatchProvider ),
m_xFrame ( _xFrame )