Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
7b66f322
Kaydet (Commit)
7b66f322
authored
Ara 12, 2012
tarafından
Cédric Bosdonnat
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Template manager: use tabs instead of buttons to filter the documents
Change-Id: I2ec7baffaf5e88c7daf6040bdac8e173651b42f1
üst
5613bcfc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
130 deletions
+79
-130
templatedlg.hxx
sfx2/inc/templatedlg.hxx
+3
-12
templatedlg.cxx
sfx2/source/doc/templatedlg.cxx
+35
-68
templatedlg.hrc
sfx2/source/doc/templatedlg.hrc
+6
-6
templatedlg.src
sfx2/source/doc/templatedlg.src
+35
-44
No files found.
sfx2/inc/templatedlg.hxx
Dosyayı görüntüle @
7b66f322
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include <vcl/dialog.hxx>
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/button.hxx>
#include <vcl/tabctrl.hxx>
class
Edit
;
class
Edit
;
class
PopupMenu
;
class
PopupMenu
;
...
@@ -45,11 +46,7 @@ public:
...
@@ -45,11 +46,7 @@ public:
void
setDocumentModel
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
frame
::
XModel
>
&
rModel
);
void
setDocumentModel
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
frame
::
XModel
>
&
rModel
);
DECL_LINK
(
ViewAllHdl
,
void
*
);
DECL_LINK
(
ActivatePageHdl
,
void
*
);
DECL_LINK
(
ViewDocsHdl
,
void
*
);
DECL_LINK
(
ViewPresentsHdl
,
void
*
);
DECL_LINK
(
ViewSheetsHdl
,
void
*
);
DECL_LINK
(
ViewDrawsHdl
,
void
*
);
private
:
private
:
...
@@ -87,8 +84,6 @@ private:
...
@@ -87,8 +84,6 @@ private:
void
OnRepositoryDelete
();
void
OnRepositoryDelete
();
void
OnTemplateSaveAs
();
void
OnTemplateSaveAs
();
void
centerTopButtons
();
void
createRepositoryMenu
();
void
createRepositoryMenu
();
void
createDefaultTemplateMenu
();
void
createDefaultTemplateMenu
();
...
@@ -116,11 +111,7 @@ private:
...
@@ -116,11 +111,7 @@ private:
private
:
private
:
PushButton
aButtonAll
;
TabControl
maTabControl
;
PushButton
aButtonDocs
;
PushButton
aButtonPresents
;
PushButton
aButtonSheets
;
PushButton
aButtonDraws
;
Control
*
mpToolbars
;
Control
*
mpToolbars
;
Edit
*
mpSearchEdit
;
Edit
*
mpSearchEdit
;
...
...
sfx2/source/doc/templatedlg.cxx
Dosyayı görüntüle @
7b66f322
...
@@ -99,12 +99,8 @@ private:
...
@@ -99,12 +99,8 @@ private:
SfxTemplateManagerDlg
::
SfxTemplateManagerDlg
(
Window
*
parent
)
SfxTemplateManagerDlg
::
SfxTemplateManagerDlg
(
Window
*
parent
)
:
ModelessDialog
(
parent
,
SfxResId
(
DLG_TEMPLATE_MANAGER
)),
:
ModelessDialog
(
parent
,
SfxResId
(
DLG_TEMPLATE_MANAGER
)),
aButtonAll
(
this
,
SfxResId
(
BTN_SELECT_ALL
)),
maTabControl
(
this
,
SfxResId
(
TAB_CONTROL
)),
aButtonDocs
(
this
,
SfxResId
(
BTN_SELECT_DOCS
)),
mpToolbars
(
new
Control
(
&
maTabControl
,
SfxResId
(
TOOLBARS
))),
aButtonPresents
(
this
,
SfxResId
(
BTN_SELECT_PRESENTATIONS
)),
aButtonSheets
(
this
,
SfxResId
(
BTN_SELECT_SHEETS
)),
aButtonDraws
(
this
,
SfxResId
(
BTN_SELECT_DRAWS
)),
mpToolbars
(
new
Control
(
this
,
SfxResId
(
TOOLBARS
))),
mpSearchEdit
(
new
Edit
(
this
,
WB_HIDE
|
WB_BORDER
)),
mpSearchEdit
(
new
Edit
(
this
,
WB_HIDE
|
WB_BORDER
)),
mpViewBar
(
new
ToolBox
(
mpToolbars
,
SfxResId
(
TBX_ACTION_VIEW
))),
mpViewBar
(
new
ToolBox
(
mpToolbars
,
SfxResId
(
TBX_ACTION_VIEW
))),
mpActionBar
(
new
ToolBox
(
mpToolbars
,
SfxResId
(
TBX_ACTION_ACTION
))),
mpActionBar
(
new
ToolBox
(
mpToolbars
,
SfxResId
(
TBX_ACTION_ACTION
))),
...
@@ -131,6 +127,14 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
...
@@ -131,6 +127,14 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
Size
aWinSize
=
GetOutputSize
();
Size
aWinSize
=
GetOutputSize
();
// Fit the tab page control and the toolbars
Size
aTabSize
=
maTabControl
.
GetSizePixel
();
Size
aTabPageSize
=
maTabControl
.
GetTabPageSizePixel
();
Point
aToolbarsPos
(
0
,
aTabSize
.
getHeight
()
-
aTabPageSize
.
getHeight
());
mpToolbars
->
SetPosPixel
(
aToolbarsPos
);
aTabPageSize
.
setHeight
(
mpToolbars
->
GetSizePixel
().
getHeight
()
+
3
);
maTabControl
.
SetTabPageSizePixel
(
aTabPageSize
);
// Calculate toolboxs size and positions
// Calculate toolboxs size and positions
Size
aViewSize
=
mpViewBar
->
CalcMinimumWindowSizePixel
();
Size
aViewSize
=
mpViewBar
->
CalcMinimumWindowSizePixel
();
Size
aActionSize
=
mpActionBar
->
CalcMinimumWindowSizePixel
();
Size
aActionSize
=
mpActionBar
->
CalcMinimumWindowSizePixel
();
...
@@ -166,7 +170,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
...
@@ -166,7 +170,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
// Set view position below toolbox
// Set view position below toolbox
Point
aViewPos
=
maView
->
GetPosPixel
();
Point
aViewPos
=
maView
->
GetPosPixel
();
aViewPos
.
setY
(
m
pToolbars
->
GetPosPixel
().
Y
()
+
mpToolbars
->
GetSizePixel
().
getHeight
());
aViewPos
.
setY
(
m
aTabControl
.
GetPosPixel
().
Y
()
+
maTabControl
.
GetSizePixel
().
getHeight
());
aViewPos
.
setX
(
0
);
aViewPos
.
setX
(
0
);
Size
aThumbSize
(
aWinSize
.
getWidth
(),
aWinSize
.
getHeight
()
-
aViewPos
.
getY
());
Size
aThumbSize
(
aWinSize
.
getWidth
(),
aWinSize
.
getHeight
()
-
aViewPos
.
getY
());
maView
->
SetPosSizePixel
(
aViewPos
,
aThumbSize
);
maView
->
SetPosSizePixel
(
aViewPos
,
aThumbSize
);
...
@@ -179,7 +183,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
...
@@ -179,7 +183,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
aSearchSize
.
setWidth
(
aWinSize
.
getWidth
()
-
2
*
PADDING_DLG_BORDER
);
aSearchSize
.
setWidth
(
aWinSize
.
getWidth
()
-
2
*
PADDING_DLG_BORDER
);
mpSearchEdit
->
SetSizePixel
(
aSearchSize
);
mpSearchEdit
->
SetSizePixel
(
aSearchSize
);
mpSearchEdit
->
SetPosPixel
(
Point
(
PADDING_DLG_BORDER
,
a
ActionPos
.
Y
()
+
aActionSize
.
getHeight
()));
mpSearchEdit
->
SetPosPixel
(
Point
(
PADDING_DLG_BORDER
,
a
ViewPos
.
Y
()));
mpSearchEdit
->
SetUpdateDataHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
SearchUpdateHdl
));
mpSearchEdit
->
SetUpdateDataHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
SearchUpdateHdl
));
mpSearchEdit
->
EnableUpdateData
();
mpSearchEdit
->
EnableUpdateData
();
...
@@ -218,17 +222,11 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
...
@@ -218,17 +222,11 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
mpSearchView
->
setItemStateHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
TVTemplateStateHdl
));
mpSearchView
->
setItemStateHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
TVTemplateStateHdl
));
aButtonAll
.
SetClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
ViewAllHdl
));
maTabControl
.
SetActivatePageHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
ActivatePageHdl
));
aButtonDocs
.
SetClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
ViewDocsHdl
));
aButtonPresents
.
SetClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
ViewPresentsHdl
));
aButtonSheets
.
SetClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
ViewSheetsHdl
));
aButtonDraws
.
SetClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
ViewDrawsHdl
));
// Set dialog to correct dimensions
// Set dialog to correct dimensions
SetSizePixel
(
aWinSize
);
SetSizePixel
(
aWinSize
);
centerTopButtons
();
mpViewBar
->
Show
();
mpViewBar
->
Show
();
mpActionBar
->
Show
();
mpActionBar
->
Show
();
...
@@ -285,33 +283,28 @@ void SfxTemplateManagerDlg::setDocumentModel(const uno::Reference<frame::XModel>
...
@@ -285,33 +283,28 @@ void SfxTemplateManagerDlg::setDocumentModel(const uno::Reference<frame::XModel>
m_xModel
=
rModel
;
m_xModel
=
rModel
;
}
}
IMPL_LINK_NOARG
(
SfxTemplateManagerDlg
,
ViewAllHdl
)
IMPL_LINK_NOARG
(
SfxTemplateManagerDlg
,
ActivatePageHdl
)
{
mpCurView
->
filterTemplatesByApp
(
FILTER_APP_NONE
);
return
0
;
}
IMPL_LINK_NOARG
(
SfxTemplateManagerDlg
,
ViewDocsHdl
)
{
mpCurView
->
filterTemplatesByApp
(
FILTER_APP_WRITER
);
return
0
;
}
IMPL_LINK_NOARG
(
SfxTemplateManagerDlg
,
ViewPresentsHdl
)
{
mpCurView
->
filterTemplatesByApp
(
FILTER_APP_IMPRESS
);
return
0
;
}
IMPL_LINK_NOARG
(
SfxTemplateManagerDlg
,
ViewSheetsHdl
)
{
mpCurView
->
filterTemplatesByApp
(
FILTER_APP_CALC
);
return
0
;
}
IMPL_LINK_NOARG
(
SfxTemplateManagerDlg
,
ViewDrawsHdl
)
{
{
mpCurView
->
filterTemplatesByApp
(
FILTER_APP_DRAW
);
FILTER_APPLICATION
eFilter
=
FILTER_APP_NONE
;
switch
(
maTabControl
.
GetCurPageId
())
{
case
FILTER_DOCS
:
eFilter
=
FILTER_APP_WRITER
;
break
;
case
FILTER_PRESENTATIONS
:
eFilter
=
FILTER_APP_IMPRESS
;
break
;
case
FILTER_SHEETS
:
eFilter
=
FILTER_APP_CALC
;
break
;
case
FILTER_DRAWS
:
eFilter
=
FILTER_APP_DRAW
;
break
;
default
:
case
FILTER_ALL
:
;
}
mpCurView
->
filterTemplatesByApp
(
eFilter
);
return
0
;
return
0
;
}
}
...
@@ -927,7 +920,7 @@ void SfxTemplateManagerDlg::OnTemplateSearch ()
...
@@ -927,7 +920,7 @@ void SfxTemplateManagerDlg::OnTemplateSearch ()
mpActionBar
->
SetItemState
(
TBI_TEMPLATE_SEARCH
,
STATE_CHECK
);
mpActionBar
->
SetItemState
(
TBI_TEMPLATE_SEARCH
,
STATE_CHECK
);
}
}
SetSizePixel
(
aWinSize
);
//
SetSizePixel(aWinSize);
maView
->
SetPosPixel
(
aPos
);
maView
->
SetPosPixel
(
aPos
);
mpOnlineView
->
SetPosPixel
(
aPos
);
mpOnlineView
->
SetPosPixel
(
aPos
);
mpSearchView
->
SetPosPixel
(
aPos
);
mpSearchView
->
SetPosPixel
(
aPos
);
...
@@ -1194,32 +1187,6 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
...
@@ -1194,32 +1187,6 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
}
}
}
}
void
SfxTemplateManagerDlg
::
centerTopButtons
()
{
Point
aFirstBtnPos
=
aButtonAll
.
GetPosPixel
();
Size
aBtnSize
=
aButtonAll
.
GetOutputSize
();
Size
aWinSize
=
GetOutputSize
();
long
nTotalWidth
=
aBtnSize
.
getWidth
()
*
5
;
long
nSpace
=
(
aWinSize
.
getWidth
()
-
nTotalWidth
)
/
2
;
Point
aBtnPos
(
nSpace
,
aFirstBtnPos
.
getY
());
aButtonAll
.
SetPosPixel
(
aBtnPos
);
aBtnPos
.
setX
(
aBtnPos
.
getX
()
+
aBtnSize
.
getWidth
());
aButtonDocs
.
SetPosPixel
(
aBtnPos
);
aBtnPos
.
setX
(
aBtnPos
.
getX
()
+
aBtnSize
.
getWidth
());
aButtonPresents
.
SetPosPixel
(
aBtnPos
);
aBtnPos
.
setX
(
aBtnPos
.
getX
()
+
aBtnSize
.
getWidth
());
aButtonSheets
.
SetPosPixel
(
aBtnPos
);
aBtnPos
.
setX
(
aBtnPos
.
getX
()
+
aBtnSize
.
getWidth
());
aButtonDraws
.
SetPosPixel
(
aBtnPos
);
}
void
SfxTemplateManagerDlg
::
createRepositoryMenu
()
void
SfxTemplateManagerDlg
::
createRepositoryMenu
()
{
{
mpRepositoryMenu
->
Clear
();
mpRepositoryMenu
->
Clear
();
...
...
sfx2/source/doc/templatedlg.hrc
Dosyayı görüntüle @
7b66f322
...
@@ -6,12 +6,12 @@
...
@@ -6,12 +6,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
*/
#define
BTN_SELECT_ALL
1
#define
TAB_CONTROL
1
#define
BTN_SELECT_DOCS
2
#define
FILTER_ALL
2
#define
BTN_SELECT_PRESENTATIONS
3
#define
FILTER_DOCS
3
#define
BTN_SELECT_SHEETS
4
#define
FILTER_PRESENTATIONS
4
#define
BTN_SELECT_DRAWS
5
#define
FILTER_SHEETS
5
#define
BTN_SELECTION_MODE
6
#define
FILTER_DRAWS
6
#define TEMPLATE_VIEW 7
#define TEMPLATE_VIEW 7
...
...
sfx2/source/doc/templatedlg.src
Dosyayı görüntüle @
7b66f322
...
@@ -111,50 +111,43 @@ ModelessDialog DLG_TEMPLATE_MANAGER
...
@@ -111,50 +111,43 @@ ModelessDialog DLG_TEMPLATE_MANAGER
Size = MAP_APPFONT ( 290 , 250 );
Size = MAP_APPFONT ( 290 , 250 );
Text [en-US] = "Template Manager";
Text [en-US] = "Template Manager";
PushButton BTN_SELECT_AL
L
TabControl TAB_CONTRO
L
{
{
Pos = MAP_APPFONT(10,5);
OutputSize = TRUE;
Size = MAP_APPFONT(50,14);
Size = MAP_APPFONT( 290, 22 );
TabStop = TRUE;
Pos = MAP_APPFONT( 0, 0 );
DefButton = TRUE;
PageList =
Text [en-US] = "All";
{
};
PageItem
{
PushButton BTN_SELECT_DOCS
Identifier = FILTER_ALL;
{
Text [ en-US ] = "All";
Pos = MAP_APPFONT(60,5);
};
Size = MAP_APPFONT(50,14);
PageItem
TabStop = TRUE;
{
Text [en-US] = "Documents";
Identifier = FILTER_DOCS;
};
Text [ en-US ] = "Documents";
};
PushButton BTN_SELECT_PRESENTATIONS
PageItem
{
{
Pos = MAP_APPFONT(110,5);
Identifier = FILTER_SHEETS;
Size = MAP_APPFONT(50,14);
Text [ en-US ] = "Spreadsheets";
TabStop = TRUE;
};
Text [en-US] = "Presentations";
PageItem
};
{
Identifier = FILTER_PRESENTATIONS;
PushButton BTN_SELECT_SHEETS
Text [ en-US ] = "Presentations";
{
};
Pos = MAP_APPFONT(160,5);
PageItem
Size = MAP_APPFONT(50,14);
{
TabStop = TRUE;
Identifier = FILTER_DRAWS;
Text [en-US] = "Spreadsheets";
Text [ en-US ] = "Drawings";
};
};
};
PushButton BTN_SELECT_DRAWS
{
Pos = MAP_APPFONT(210,5);
Size = MAP_APPFONT(50,14);
TabStop = TRUE;
Text [en-US] = "Drawings";
};
};
Control TEMPLATE_VIEW
Control TEMPLATE_VIEW
{
{
Pos = MAP_APPFONT(5,30);
Size = MAP_APPFONT(280,220);
Size = MAP_APPFONT(280,220);
TabStop = TRUE;
TabStop = TRUE;
};
};
...
@@ -177,8 +170,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER
...
@@ -177,8 +170,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER
Control TOOLBARS
Control TOOLBARS
{
{
Pos = MAP_APPFONT( 0 , 22 );
Size = MAP_APPFONT( 290 , 16 );
Size = MAP_APPFONT( 290 , 20 );
TabStop = False;
TabStop = False;
};
};
...
@@ -242,7 +234,6 @@ ModelessDialog DLG_TEMPLATE_MANAGER
...
@@ -242,7 +234,6 @@ ModelessDialog DLG_TEMPLATE_MANAGER
ToolBox TBX_ACTION_ACTION
ToolBox TBX_ACTION_ACTION
{
{
SVLook = TRUE ;
SVLook = TRUE ;
TabStop = TRUE ;
Pos = MAP_APPFONT ( 4 , 0 ) ;
Pos = MAP_APPFONT ( 4 , 0 ) ;
ItemList =
ItemList =
...
@@ -254,7 +245,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER
...
@@ -254,7 +245,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER
ItemImage = Image
ItemImage = Image
{
{
ImageBitmap = Bitmap { File = "
search
.png" ; };
ImageBitmap = Bitmap { File = "
actionaction012
.png" ; };
};
};
};
};
...
@@ -265,7 +256,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER
...
@@ -265,7 +256,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER
ItemImage = Image
ItemImage = Image
{
{
ImageBitmap = Bitmap { File = "
exec_action
.png" ; };
ImageBitmap = Bitmap { File = "
actionaction013
.png" ; };
};
};
};
};
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment