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
5918209d
Kaydet (Commit)
5918209d
authored
Haz 06, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: fdo#73675 tweak conversion to use SvSimpleTable
Change-Id: Ibfa5c806581c450a0b0407cb07751e06dd3a787e
üst
c45c6e41
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
86 deletions
+55
-86
condformatmgr.cxx
sc/source/ui/condformat/condformatmgr.cxx
+33
-58
condformatmgr.hxx
sc/source/ui/inc/condformatmgr.hxx
+5
-11
condformatmanager.ui
sc/uiconfig/scalc/ui/condformatmanager.ui
+17
-17
No files found.
sc/source/ui/condformat/condformatmgr.cxx
Dosyayı görüntüle @
5918209d
...
...
@@ -18,36 +18,22 @@
#define ITEMID_CONDITION 2
ScCondFormatManagerWindow
::
ScCondFormatManagerWindow
(
Window
*
pParent
,
ScDocument
*
pDoc
,
ScConditionalFormatList
*
pFormatList
)
:
S
vTabListBox
(
pParent
,
WB_BORDER
|
WB_HSCROLL
|
WB_SORT
|
WB_CLIPCHILDREN
|
WB_TABSTOP
),
maHeaderBar
(
pParent
,
WB_BUTTONSTYLE
|
WB_BOTTOMBORDER
),
mpDoc
(
pDoc
),
mpFormatList
(
pFormatList
)
ScCondFormatManagerWindow
::
ScCondFormatManagerWindow
(
SvSimpleTableContainer
&
rParent
,
S
cDocument
*
pDoc
,
ScConditionalFormatList
*
pFormatList
)
:
SvSimpleTable
(
rParent
,
WB_HSCROLL
|
WB_SORT
|
WB_TABSTOP
)
,
mpDoc
(
pDoc
)
,
mpFormatList
(
pFormatList
)
{
Size
aBoxSize
(
pParent
->
GetOutputSizePixel
()
);
maHeaderBar
.
SetPosSizePixel
(
Point
(
0
,
0
),
Size
(
aBoxSize
.
Width
(),
16
)
);
OUString
aConditionStr
(
ScGlobal
::
GetRscString
(
STR_HEADER_COND
));
OUString
aRangeStr
(
ScGlobal
::
GetRscString
(
STR_HEADER_RANGE
));
long
nTabSize
=
aBoxSize
.
Width
()
/
2
;
maHeaderBar
.
InsertItem
(
ITEMID_RANGE
,
aRangeStr
,
nTabSize
,
HIB_LEFT
|
HIB_VCENTER
);
maHeaderBar
.
InsertItem
(
ITEMID_CONDITION
,
aConditionStr
,
nTabSize
,
HIB_LEFT
|
HIB_VCENTER
);
static
long
nTabs
[]
=
{
2
,
0
,
nTabSize
};
Size
aHeadSize
(
maHeaderBar
.
GetSizePixel
()
);
//pParent->SetFocusControl( this );
SetPosSizePixel
(
Point
(
0
,
aHeadSize
.
Height
()
),
Size
(
aBoxSize
.
Width
(),
aBoxSize
.
Height
()
-
aHeadSize
.
Height
()
)
);
SetTabs
(
&
nTabs
[
0
],
MAP_PIXEL
);
maHeaderBar
.
SetEndDragHdl
(
LINK
(
this
,
ScCondFormatManagerWindow
,
HeaderEndDragHdl
)
);
HeaderEndDragHdl
(
NULL
);
OUStringBuffer
sHeader
;
sHeader
.
append
(
aRangeStr
).
append
(
"
\t
"
).
append
(
aConditionStr
);
InsertHeaderEntry
(
sHeader
.
makeStringAndClear
(),
HEADERBAR_APPEND
,
HIB_LEFT
|
HIB_VCENTER
);
setColSizes
();
Init
();
Show
();
maHeaderBar
.
Show
();
SetSelectionMode
(
MULTIPLE_SELECTION
);
}
...
...
@@ -70,15 +56,18 @@ void ScCondFormatManagerWindow::Init()
SvTreeListEntry
*
pEntry
=
InsertEntryToColumn
(
createEntryString
(
*
itr
),
TREELIST_APPEND
,
0xffff
);
maMapLBoxEntryToCondIndex
.
insert
(
std
::
pair
<
SvTreeListEntry
*
,
sal_Int32
>
(
pEntry
,
itr
->
GetKey
()));
}
SetUpdateMode
(
true
);
if
(
mpFormatList
->
size
())
SelectRow
(
0
);
}
void
ScCondFormatManagerWindow
::
ChangeSize
(
Size
aSize
)
void
ScCondFormatManagerWindow
::
Resize
(
)
{
maHeaderBar
.
SetSizePixel
(
Size
(
aSize
.
Width
(),
16
)
);
Size
aHeadSize
(
maHeaderBar
.
GetSizePixel
()
);
SetSizePixel
(
Size
(
aSize
.
Width
(),
aSize
.
Height
()
-
aHeadSize
.
Height
()
)
);
HeaderEndDragHdl
(
NULL
);
SvSimpleTable
::
Resize
();
if
(
GetParentDialog
()
->
isCalculatingInitialLayoutSize
())
setColSizes
();
}
void
ScCondFormatManagerWindow
::
DeleteSelection
()
...
...
@@ -111,23 +100,14 @@ void ScCondFormatManagerWindow::Update()
Init
();
}
IMPL_LINK_NOARG
(
ScCondFormatManagerWindow
,
HeaderEndDragHdl
)
void
ScCondFormatManagerWindow
::
setColSizes
(
)
{
long
aTableSize
=
maHeaderBar
.
GetSizePixel
().
Width
();
long
aItemRangeSize
=
maHeaderBar
.
GetItemSize
(
ITEMID_RANGE
);
//calculate column size based on user input and minimum size
long
aItemCondSize
=
aTableSize
-
aItemRangeSize
;
Size
aSz
;
aSz
.
Width
()
=
aItemRangeSize
;
SetTab
(
ITEMID_RANGE
,
PixelToLogic
(
aSz
,
MapMode
(
MAP_APPFONT
)
).
Width
(),
MAP_APPFONT
);
maHeaderBar
.
SetItemSize
(
ITEMID_RANGE
,
aItemRangeSize
);
aSz
.
Width
()
+=
aItemCondSize
;
SetTab
(
ITEMID_CONDITION
,
PixelToLogic
(
aSz
,
MapMode
(
MAP_APPFONT
)
).
Width
(),
MAP_APPFONT
);
maHeaderBar
.
SetItemSize
(
ITEMID_CONDITION
,
aItemCondSize
);
return
0
;
HeaderBar
&
rBar
=
GetTheHeaderBar
();
if
(
rBar
.
GetItemCount
()
<
2
)
return
;
long
aStaticTabs
[]
=
{
2
,
0
,
0
};
aStaticTabs
[
2
]
=
rBar
.
GetSizePixel
().
Width
()
/
2
;
SvSimpleTable
::
SetTabs
(
aStaticTabs
,
MAP_PIXEL
);
}
ScCondFormatManagerDlg
::
ScCondFormatManagerDlg
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScConditionalFormatList
*
pFormatList
,
const
ScAddress
&
rPos
)
:
...
...
@@ -137,13 +117,14 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(Window* pParent, ScDocument* pDoc
maPos
(
rPos
),
mbModified
(
false
)
{
get
(
m_pGrid
,
"dialog-vbox1"
);
get
(
m_pContainer
,
"CONTAINER"
);
m_pContainer
->
SetSizePixel
(
Size
(
300
,
100
));
m_pCtrlManager
=
new
ScCondFormatManagerWindow
(
m_pContainer
,
mpDoc
,
mpFormatList
);
get
(
m_pBtnAdd
,
"ADD"
);
get
(
m_pBtnRemove
,
"REMOVE"
);
get
(
m_pBtnEdit
,
"EDIT"
);
SvSimpleTableContainer
*
pContainer
=
get
<
SvSimpleTableContainer
>
(
"CONTAINER"
);
Size
aSize
(
LogicToPixel
(
Size
(
290
,
220
),
MAP_APPFONT
));
pContainer
->
set_width_request
(
aSize
.
Width
());
pContainer
->
set_height_request
(
aSize
.
Height
());
m_pCtrlManager
=
new
ScCondFormatManagerWindow
(
*
pContainer
,
mpDoc
,
mpFormatList
);
get
(
m_pBtnAdd
,
"add"
);
get
(
m_pBtnRemove
,
"remove"
);
get
(
m_pBtnEdit
,
"edit"
);
m_pBtnRemove
->
SetClickHdl
(
LINK
(
this
,
ScCondFormatManagerDlg
,
RemoveBtnHdl
));
m_pBtnEdit
->
SetClickHdl
(
LINK
(
this
,
ScCondFormatManagerDlg
,
EditBtnHdl
));
...
...
@@ -151,16 +132,10 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(Window* pParent, ScDocument* pDoc
m_pCtrlManager
->
SetDoubleClickHdl
(
LINK
(
this
,
ScCondFormatManagerDlg
,
EditBtnHdl
));
}
void
ScCondFormatManagerDlg
::
Resize
()
{
m_pGrid
->
SetSizePixel
(
Size
(
GetOutputSizePixel
().
Width
()
-
12
,
GetOutputSizePixel
().
Height
()
-
12
));
m_pCtrlManager
->
ChangeSize
(
Size
(
GetOutputSizePixel
().
Width
()
-
18
,
GetOutputSizePixel
().
Height
()
-
100
));
}
ScCondFormatManagerDlg
::~
ScCondFormatManagerDlg
()
{
delete
mpFormatList
;
delete
m_pCtrlManager
;
delete
mpFormatList
;
}
bool
ScCondFormatManagerDlg
::
IsInRefMode
()
const
...
...
sc/source/ui/inc/condformatmgr.hxx
Dosyayı görüntüle @
5918209d
...
...
@@ -17,7 +17,7 @@
#include <svtools/svtabbx.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <svtools/
headbar
.hxx>
#include <svtools/
simptabl
.hxx>
#include "conditio.hxx"
...
...
@@ -25,26 +25,24 @@
class
ScDocument
;
class
ScCondFormatManagerWindow
:
public
Sv
TabListBox
class
ScCondFormatManagerWindow
:
public
Sv
SimpleTable
{
private
:
void
Init
();
OUString
createEntryString
(
const
ScConditionalFormat
&
rFormat
);
void
setColSizes
();
HeaderBar
maHeaderBar
;
ScDocument
*
mpDoc
;
ScConditionalFormatList
*
mpFormatList
;
std
::
map
<
SvTreeListEntry
*
,
sal_Int32
>
maMapLBoxEntryToCondIndex
;
DECL_LINK
(
HeaderEndDragHdl
,
void
*
);
public
:
ScCondFormatManagerWindow
(
Window
*
pParent
,
ScDocument
*
pDoc
,
ScConditionalFormatList
*
pFormatList
);
void
ChangeSize
(
Size
aSize
);
ScCondFormatManagerWindow
(
SvSimpleTableContainer
&
rParent
,
ScDocument
*
pDoc
,
ScConditionalFormatList
*
pFormatList
);
void
DeleteSelection
();
ScConditionalFormat
*
GetSelection
();
void
Update
();
virtual
void
Resize
()
SAL_OVERRIDE
;
};
class
ScCondFormatManagerDlg
:
public
ModalDialog
...
...
@@ -64,8 +62,6 @@ private:
PushButton
*
m_pBtnRemove
;
PushButton
*
m_pBtnEdit
;
ScConditionalFormatList
*
mpFormatList
;
Window
*
m_pContainer
;
VclVBox
*
m_pGrid
;
ScCondFormatManagerWindow
*
m_pCtrlManager
;
ScDocument
*
mpDoc
;
...
...
@@ -75,8 +71,6 @@ private:
DECL_LINK
(
EditBtnHdl
,
void
*
);
DECL_LINK
(
AddBtnHdl
,
void
*
);
virtual
void
Resize
();
bool
mbModified
;
};
...
...
sc/uiconfig/scalc/ui/condformatmanager.ui
Dosyayı görüntüle @
5918209d
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<requires
lib=
"gtk+"
version=
"3.0"
/>
<!-- interface-requires LibreOffice 1.0 -->
<object
class=
"GtkDialog"
id=
"CondFormatManager"
>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"border_width"
>
6
</property>
...
...
@@ -18,13 +20,14 @@
<property
name=
"can_focus"
>
False
</property>
<property
name=
"layout_style"
>
end
</property>
<child>
<object
class=
"GtkButton"
id=
"
OK
"
>
<object
class=
"GtkButton"
id=
"
ok
"
>
<property
name=
"label"
>
gtk-ok
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"can_default"
>
True
</property>
<property
name=
"has_default"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<property
name=
"use_stock"
>
True
</property>
</object>
<packing>
...
...
@@ -34,13 +37,12 @@
</packing>
</child>
<child>
<object
class=
"GtkButton"
id=
"
HELP
"
>
<property
name=
"label"
>
gtk-
help
</property>
<object
class=
"GtkButton"
id=
"
cancel
"
>
<property
name=
"label"
>
gtk-
cancel
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<property
name=
"use_stock"
>
True
</property>
</object>
<packing>
...
...
@@ -72,13 +74,12 @@
<property
name=
"spacing"
>
6
</property>
<property
name=
"layout_style"
>
start
</property>
<child>
<object
class=
"GtkButton"
id=
"
ADD
"
>
<object
class=
"GtkButton"
id=
"
add
"
>
<property
name=
"label"
translatable=
"yes"
>
Add
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"use_action_appearance"
>
False
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
...
...
@@ -87,13 +88,12 @@
</packing>
</child>
<child>
<object
class=
"GtkButton"
id=
"
EDIT
"
>
<object
class=
"GtkButton"
id=
"
edit
"
>
<property
name=
"label"
translatable=
"yes"
>
Edit...
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"use_action_appearance"
>
False
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
...
...
@@ -102,13 +102,12 @@
</packing>
</child>
<child>
<object
class=
"GtkButton"
id=
"
REMOVE
"
>
<object
class=
"GtkButton"
id=
"
remove
"
>
<property
name=
"label"
translatable=
"yes"
>
Remove
</property>
<property
name=
"use_action_appearance"
>
False
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"use_action_appearance"
>
False
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
...
...
@@ -125,13 +124,14 @@
</packing>
</child>
<child>
<object
class=
"GtkDrawingArea"
id=
"CONTAINER"
>
<property
name=
"width_request"
>
300
</property>
<property
name=
"height_request"
>
200
</property>
<object
class=
"svtlo-SvSimpleTableContainer"
id=
"CONTAINER"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"hexpand"
>
True
</property>
<property
name=
"vexpand"
>
True
</property>
<child
internal-child=
"selection"
>
<object
class=
"GtkTreeSelection"
id=
"Simple Table Container-selection1"
/>
</child>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
...
...
@@ -150,8 +150,8 @@
</object>
</child>
<action-widgets>
<action-widget
response=
"0"
>
OK
</action-widget>
<action-widget
response=
"0"
>
HELP
</action-widget>
<action-widget
response=
"0"
>
ok
</action-widget>
<action-widget
response=
"0"
>
cancel
</action-widget>
</action-widgets>
</object>
</interface>
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