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
633872e9
Kaydet (Commit)
633872e9
authored
Haz 01, 2012
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
more for conditional format dialog
Change-Id: Id99be4e98ae1cd57077ac6f3758ebdb9cfc5424c
üst
f76aa663
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
197 additions
and
113 deletions
+197
-113
sc.hrc
sc/inc/sc.hrc
+2
-1
condformatdlg.cxx
sc/source/ui/condformat/condformatdlg.cxx
+109
-33
condformatdlg.hrc
sc/source/ui/inc/condformatdlg.hrc
+0
-1
condformatdlg.hxx
sc/source/ui/inc/condformatdlg.hxx
+9
-2
condformatdlg.src
sc/source/ui/src/condformatdlg.src
+77
-76
No files found.
sc/inc/sc.hrc
Dosyayı görüntüle @
633872e9
...
...
@@ -1234,8 +1234,9 @@
#define RID_SCDLG_SORTKEY (SC_DIALOGS_START + 157)
#define RID_SCDLG_COLORSCALE (SC_DIALOGS_START + 158)
#define RID_SCDLG_DATABAR (SC_DIALOGS_START + 159)
#define RID_COND_ENTRY (SC_DIALOGS_START + 160)
#define SC_DIALOGS_END (SC_DIALOGS_START + 16
0
)
#define SC_DIALOGS_END (SC_DIALOGS_START + 16
1
)
#ifndef STD_MASKCOLOR
#define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }
...
...
sc/source/ui/condformat/condformatdlg.cxx
Dosyayı görüntüle @
633872e9
...
...
@@ -29,6 +29,8 @@
#include "condformatdlg.hxx"
#include "condformatdlg.hrc"
#include <vcl/vclevent.hxx>
#include "anyrefdg.hxx"
#include "document.hxx"
#include "conditio.hxx"
...
...
@@ -36,8 +38,9 @@
#include <iostream>
ScCondFrmtEntry
::
ScCondFrmtEntry
(
Window
*
pParent
)
:
Control
(
pParent
,
ScResId
(
CTRL
_ENTRY
)
),
Control
(
pParent
,
ScResId
(
RID_COND
_ENTRY
)
),
mbActive
(
false
),
meType
(
CONDITION
),
maLbType
(
this
,
ScResId
(
LB_TYPE
)
),
maFtCondNr
(
this
,
ScResId
(
FT_COND_NR
)
),
maFtCondition
(
this
,
ScResId
(
FT_CONDITION
)
),
...
...
@@ -54,19 +57,13 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent):
SwitchToType
(
COLLAPSED
);
FreeResource
();
maClickHdl
=
LINK
(
pParent
,
ScCondFormatList
,
EntrySelectHdl
);
maLbType
.
SelectEntryPos
(
1
);
maLbCondType
.
SelectEntryPos
(
0
);
maEdVal2
.
Hide
();
}
long
ScCondFrmtEntry
::
GetHeight
()
const
{
if
(
mbActive
)
return
100
;
else
return
10
;
}
namespace
{
rtl
::
OUString
getTextForType
(
ScCondFormatEntryType
eType
)
...
...
@@ -83,21 +80,54 @@ rtl::OUString getTextForType(ScCondFormatEntryType eType)
break
;
}
return
rtl
::
OUString
(
""
);
}
rtl
::
OUString
getExpression
(
sal_Int32
nIndex
)
{
switch
(
nIndex
)
{
case
0
:
return
rtl
::
OUString
(
"="
);
case
1
:
return
rtl
::
OUString
(
"<"
);
case
2
:
return
rtl
::
OUString
(
">"
);
case
5
:
return
rtl
::
OUString
(
"!="
);
default
:
return
rtl
::
OUString
(
"not yet supported"
);
}
return
rtl
::
OUString
();
}
}
long
ScCondFrmtEntry
::
Notify
(
NotifyEvent
&
rNEvt
)
{
if
(
rNEvt
.
GetType
()
==
EVENT_MOUSEBUTTONDOWN
)
{
std
::
cout
<<
"ButtonDown "
<<
std
::
endl
;
ImplCallEventListenersAndHandler
(
VCLEVENT_WINDOW_MOUSEBUTTONDOWN
,
maClickHdl
,
this
);
}
Control
::
Notify
(
rNEvt
);
}
void
ScCondFrmtEntry
::
SwitchToType
(
ScCondFormatEntryType
eType
)
{
switch
(
eType
)
{
case
COLLAPSED
:
maLbType
.
Hide
();
maFtCondition
.
SetText
(
getTextForType
(
meType
));
maFtCondition
.
Show
();
maEdVal2
.
Hide
();
maEdVal1
.
Hide
();
{
maLbType
.
Hide
();
rtl
::
OUStringBuffer
maCondText
(
getTextForType
(
meType
));
maCondText
.
append
(
rtl
::
OUString
(
" "
));
maCondText
.
append
(
getExpression
(
maLbCondType
.
GetSelectEntryPos
()));
maFtCondition
.
SetText
(
maCondText
.
makeStringAndClear
());
maFtCondition
.
Show
();
maEdVal2
.
Hide
();
maEdVal1
.
Hide
();
}
break
;
default
:
maLbType
.
Show
();
...
...
@@ -111,36 +141,33 @@ void ScCondFrmtEntry::SwitchToType( ScCondFormatEntryType eType )
void
ScCondFrmtEntry
::
Select
()
{
mbActive
=
!
mbActive
;
Size
aSize
=
GetSizePixel
();
aSize
.
Height
()
=
130
;
SetSizePixel
(
aSize
);
SetControlBackground
(
Color
(
COL_RED
));
SwitchToType
(
meType
);
}
if
(
mbActive
)
{
Size
aSize
=
GetSizePixel
();
aSize
.
Height
()
+=
120
;
SetSizePixel
(
aSize
);
SetControlBackground
(
Color
(
COL_RED
));
SwitchToType
(
meType
);
}
else
{
Size
aSize
=
GetSizePixel
();
aSize
.
Height
()
=
60
;
SetSizePixel
(
aSize
);
SetControlBackground
(
GetSettings
().
GetStyleSettings
().
GetDialogColor
());
SwitchToType
(
COLLAPSED
);
}
void
ScCondFrmtEntry
::
Deselect
()
{
Size
aSize
=
GetSizePixel
();
aSize
.
Height
()
=
40
;
SetSizePixel
(
aSize
);
SetControlBackground
(
GetSettings
().
GetStyleSettings
().
GetDialogColor
());
SwitchToType
(
COLLAPSED
);
}
ScCondFormatList
::
ScCondFormatList
(
Window
*
pParent
,
const
ResId
&
rResId
)
:
Control
(
pParent
,
rResId
),
mbHasScrollBar
(
false
),
mpScrollBar
(
NULL
),
mpScrollBar
(
new
ScrollBar
(
this
,
WB_VERT
)
),
mnTopIndex
(
0
)
{
mpScrollBar
->
SetScrollHdl
(
LINK
(
this
,
ScCondFormatList
,
ScrollHdl
)
);
mpScrollBar
->
EnableDrag
();
maEntries
.
push_back
(
new
ScCondFrmtEntry
(
this
)
);
maEntries
.
push_back
(
new
ScCondFrmtEntry
(
this
)
);
maEntries
.
push_back
(
new
ScCondFrmtEntry
(
this
)
);
maEntries
[
1
].
Select
();
RecalcAll
();
FreeResource
();
...
...
@@ -148,10 +175,43 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId):
void
ScCondFormatList
::
RecalcAll
()
{
sal_Int32
nTotalHeight
=
0
;
for
(
EntryContainer
::
iterator
itr
=
maEntries
.
begin
();
itr
!=
maEntries
.
end
();
++
itr
)
{
nTotalHeight
+=
itr
->
GetSizePixel
().
Height
();
}
Size
aCtrlSize
=
GetOutputSize
();
long
nSrcBarSize
=
GetSettings
().
GetStyleSettings
().
GetScrollBarSize
();
if
(
nTotalHeight
>
GetSizePixel
().
Height
())
{
mbHasScrollBar
=
true
;
mpScrollBar
->
SetPosSizePixel
(
Point
(
aCtrlSize
.
Width
()
-
nSrcBarSize
,
0
),
Size
(
nSrcBarSize
,
aCtrlSize
.
Height
())
);
std
::
cout
<<
"Need ScrollBar"
<<
std
::
endl
;
mpScrollBar
->
SetRangeMax
(
nTotalHeight
);
mpScrollBar
->
SetVisibleSize
(
aCtrlSize
.
Height
());
mpScrollBar
->
Show
();
}
else
{
std
::
cout
<<
"Don't need ScrollBar"
<<
std
::
endl
;
mbHasScrollBar
=
false
;
mpScrollBar
->
Hide
();
}
Point
aPoint
(
0
,
0
);
for
(
EntryContainer
::
iterator
itr
=
maEntries
.
begin
();
itr
!=
maEntries
.
end
();
++
itr
)
{
itr
->
SetPosPixel
(
aPoint
);
Size
aSize
=
itr
->
GetSizePixel
();
if
(
mbHasScrollBar
)
aSize
.
Width
()
=
aCtrlSize
.
Width
()
-
nSrcBarSize
;
else
aSize
.
Width
()
=
aCtrlSize
.
Width
();
itr
->
SetSizePixel
(
aSize
);
aPoint
.
Y
()
+=
itr
->
GetSizePixel
().
Height
();
}
}
...
...
@@ -183,6 +243,22 @@ IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl )
return
0
;
}
IMPL_LINK
(
ScCondFormatList
,
EntrySelectHdl
,
ScCondFrmtEntry
*
,
pEntry
)
{
for
(
EntryContainer
::
iterator
itr
=
maEntries
.
begin
();
itr
!=
maEntries
.
end
();
++
itr
)
{
itr
->
Deselect
();
}
pEntry
->
Select
();
RecalcAll
();
return
0
;
}
IMPL_LINK_NOARG
(
ScCondFormatList
,
ScrollHdl
)
{
return
0
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/inc/condformatdlg.hrc
Dosyayı görüntüle @
633872e9
...
...
@@ -35,7 +35,6 @@
#define BTN_REMOVE 11
#define CTRL_LIST 12
#define CTRL_ENTRY 13
#define LB_TYPE 14
#define FT_COND_NR 15
...
...
sc/source/ui/inc/condformatdlg.hxx
Dosyayı görüntüle @
633872e9
...
...
@@ -36,6 +36,7 @@
#include "rangelst.hxx"
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/scoped_ptr.hpp>
class
ScDocument
;
class
ScConditionalFormat
;
...
...
@@ -54,6 +55,8 @@ private:
bool
mbActive
;
ScCondFormatEntryType
meType
;
Link
maClickHdl
;
//general ui elements
ListBox
maLbType
;
FixedText
maFtCondNr
;
...
...
@@ -75,8 +78,10 @@ private:
public
:
ScCondFrmtEntry
(
Window
*
pParent
);
long
GetHeight
()
const
;
virtual
long
Notify
(
NotifyEvent
&
rNEvt
);
void
Select
();
void
Deselect
();
};
class
ScCondFormatList
:
public
Control
...
...
@@ -86,7 +91,7 @@ private:
EntryContainer
maEntries
;
bool
mbHasScrollBar
;
ScrollBar
*
mpScrollBar
;
boost
::
scoped_ptr
<
ScrollBar
>
mpScrollBar
;
long
mnTopIndex
;
void
RecalcAll
();
...
...
@@ -94,6 +99,8 @@ public:
ScCondFormatList
(
Window
*
pParent
,
const
ResId
&
rResId
);
DECL_LINK
(
AddBtnHdl
,
void
*
);
DECL_LINK
(
ScrollHdl
,
void
*
);
DECL_LINK
(
EntrySelectHdl
,
ScCondFrmtEntry
*
);
};
...
...
sc/source/ui/src/condformatdlg.src
Dosyayı görüntüle @
633872e9
...
...
@@ -67,85 +67,86 @@ ModalDialog RID_SCDLG_CONDFORMAT
Pos = MAP_APPFONT( 5, 20 );
Size = MAP_APPFONT( 190, 120 );
Control CTRL_ENTRY
{
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 190, 40 );
Border = TRUE;
};
};
FixedText FT_COND_NR
{
Pos = MAP_APPFONT( 2, 2 );
Size = MAP_APPFONT( 30, 10 );
Text [ en-US ] = "Condition";
};
Control RID_COND_ENTRY
{
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 190, 40 );
Border = TRUE;
FixedText FT_CONDITION
{
Pos = MAP_APPFONT( 40, 2 );
Size = MAP_APPFONT( 30, 10 );
};
FixedText FT_COND_NR
{
Pos = MAP_APPFONT( 2, 2 );
Size = MAP_APPFONT( 30, 10 );
Text [ en-US ] = "Condition";
};
ListBox LB_TYPE
{
Pos = MAP_APPFONT( 5, 15 );
Size = MAP_APPFONT( 40, 14 );
Border = TRUE;
DropDown = TRUE;
StringList [ en-US ] =
{
"All Cells";
"Cell value is";
"Formula is";
};
};
ListBox LB_CELLIS_TYPE
{
Pos = MAP_APPFONT( 50, 15 );
Size = MAP_APPFONT( 30, 14 );
Border = TRUE;
DropDown = TRUE;
StringList [ en-US ] =
{
"equal to";
"less than";
"greater than";
"less than or equal to";
"greater than or equal to";
"not equal to";
"between";
"not between";
};
};
FixedText FT_STYLE
{
Pos = MAP_APPFONT( 10, 32 );
Size = MAP_APPFONT( 35, 14 );
Text [ en-US ] = "Apply Style";
};
Edit ED_VAL1
{
Pos = MAP_APPFONT( 90, 15 );
Size = MAP_APPFONT( 70, 14 );
Border = TRUE;
};
Edit ED_VAL2
{
Pos = MAP_APPFONT( 130, 15 );
Size = MAP_APPFONT( 30, 14 );
Border = TRUE;
};
ListBox LB_STYLE
{
Pos = MAP_APPFONT( 50, 32 );
Size = MAP_APPFONT( 30, 14 );
Border = TRUE;
DropDown = TRUE;
StringList [ en-US ] =
{
"New Style...";
};
};
FixedText FT_CONDITION
{
Pos = MAP_APPFONT( 40, 2 );
Size = MAP_APPFONT( 90, 10 );
};
ListBox LB_TYPE
{
Pos = MAP_APPFONT( 5, 15 );
Size = MAP_APPFONT( 40, 14 );
Border = TRUE;
DropDown = TRUE;
StringList [ en-US ] =
{
"All Cells";
"Cell value is";
"Formula is";
};
};
ListBox LB_CELLIS_TYPE
{
Pos = MAP_APPFONT( 50, 15 );
Size = MAP_APPFONT( 30, 14 );
Border = TRUE;
DropDown = TRUE;
StringList [ en-US ] =
{
"equal to";
"less than";
"greater than";
"less than or equal to";
"greater than or equal to";
"not equal to";
"between";
"not between";
};
};
FixedText FT_STYLE
{
Pos = MAP_APPFONT( 10, 32 );
Size = MAP_APPFONT( 35, 14 );
Text [ en-US ] = "Apply Style";
};
Edit ED_VAL1
{
Pos = MAP_APPFONT( 90, 15 );
Size = MAP_APPFONT( 70, 14 );
Border = TRUE;
};
Edit ED_VAL2
{
Pos = MAP_APPFONT( 130, 15 );
Size = MAP_APPFONT( 30, 14 );
Border = TRUE;
};
ListBox LB_STYLE
{
Pos = MAP_APPFONT( 50, 32 );
Size = MAP_APPFONT( 30, 14 );
Border = TRUE;
DropDown = TRUE;
StringList [ en-US ] =
{
"New Style...";
};
};
};
...
...
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