diff options
author | sk94 <eszkadev@gmail.com> | 2014-06-06 00:27:57 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-06 12:36:13 +0000 |
commit | c45c6e4116b30a90dd69c7d9dda1eac6c0597c7f (patch) | |
tree | 7a165c2ccfbc16d484628b9961dbf88545edb91d | |
parent | bbb44f9d9b6a1f658b722eb4fc99dc42d1739edc (diff) |
RID_SCDLG_COND_FORMAT_MANAGER conversion to .ui
Change-Id: If3e0ac5afd73ed31f8c21ab68d0c3c765cb447f4
Reviewed-on: https://gerrit.libreoffice.org/9660
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/AllLangResTarget_sc.mk | 1 | ||||
-rw-r--r-- | sc/UIConfig_scalc.mk | 1 | ||||
-rw-r--r-- | sc/source/ui/condformat/condformatmgr.cxx | 73 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatmgr.hrc | 18 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatmgr.hxx | 37 | ||||
-rw-r--r-- | sc/source/ui/src/condformatmgr.src | 67 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/condformatmanager.ui | 157 |
7 files changed, 201 insertions, 153 deletions
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk index 3a178588cf6c..4f8a080d66dc 100644 --- a/sc/AllLangResTarget_sc.mk +++ b/sc/AllLangResTarget_sc.mk @@ -43,7 +43,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\ sc/source/ui/src/scstring.src \ sc/source/ui/src/filter.src \ sc/source/ui/src/condformatdlg.src \ - sc/source/ui/src/condformatmgr.src \ sc/source/ui/cctrl/checklistmenu.src \ sc/source/ui/navipi/navipi.src \ sc/source/ui/styleui/scstyles.src \ diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 15d515c4ba5a..ab736b825a12 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -69,6 +69,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/chardialog \ sc/uiconfig/scalc/ui/colorrowdialog \ sc/uiconfig/scalc/ui/colwidthdialog \ + sc/uiconfig/scalc/ui/condformatmanager \ sc/uiconfig/scalc/ui/conditionalformatdialog \ sc/uiconfig/scalc/ui/consolidatedialog \ sc/uiconfig/scalc/ui/correlationdialog \ diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 83185cddc1c6..6a9ea4415a17 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -8,7 +8,6 @@ */ #include "condformatmgr.hxx" -#include "condformatmgr.hrc" #include "scresid.hxx" #include "globstr.hrc" #include "condformatdlg.hxx" @@ -20,7 +19,7 @@ ScCondFormatManagerWindow::ScCondFormatManagerWindow(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList): - SvTabListBox(pParent, WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP), + SvTabListBox(pParent, WB_BORDER | WB_HSCROLL | WB_SORT | WB_CLIPCHILDREN | WB_TABSTOP), maHeaderBar( pParent, WB_BUTTONSTYLE | WB_BOTTOMBORDER ), mpDoc(pDoc), mpFormatList(pFormatList) @@ -74,6 +73,14 @@ void ScCondFormatManagerWindow::Init() SetUpdateMode(true); } +void ScCondFormatManagerWindow::ChangeSize(Size aSize) +{ + maHeaderBar.SetSizePixel( Size( aSize.Width(), 16 ) ); + Size aHeadSize( maHeaderBar.GetSizePixel() ); + SetSizePixel( Size( aSize.Width(), aSize.Height() - aHeadSize.Height() ) ); + HeaderEndDragHdl(NULL); +} + void ScCondFormatManagerWindow::DeleteSelection() { if(GetSelectionCount()) @@ -123,52 +130,37 @@ IMPL_LINK_NOARG(ScCondFormatManagerWindow, HeaderEndDragHdl) return 0; } -ScCondFormatManagerCtrl::ScCondFormatManagerCtrl(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList): - Control(pParent, ScResId(CTRL_TABLE)), - maWdManager(this, pDoc, pFormatList) -{ -} - -ScConditionalFormat* ScCondFormatManagerCtrl::GetSelection() -{ - return maWdManager.GetSelection(); -} - -void ScCondFormatManagerCtrl::DeleteSelection() -{ - maWdManager.DeleteSelection(); -} - -void ScCondFormatManagerCtrl::Update() -{ - maWdManager.Update(); -} - ScCondFormatManagerDlg::ScCondFormatManagerDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScAddress& rPos): - ModalDialog(pParent, ScResId(RID_SCDLG_COND_FORMAT_MANAGER)), - maBtnAdd(this, ScResId(BTN_ADD)), - maBtnRemove(this, ScResId(BTN_REMOVE)), - maBtnEdit(this, ScResId(BTN_EDIT)), - maBtnOk(this, ScResId(BTN_OK)), - maBtnCancel(this, ScResId(BTN_CANCEL)), - maFlLine(this, ScResId(FL_LINE)), + ModalDialog(pParent, "CondFormatManager", "modules/scalc/ui/condformatmanager.ui"), mpFormatList( pFormatList ? new ScConditionalFormatList(*pFormatList) : NULL), - maCtrlManager(this, pDoc, mpFormatList), mpDoc(pDoc), maPos(rPos), mbModified(false) { - FreeResource(); + 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"); + + m_pBtnRemove->SetClickHdl(LINK(this, ScCondFormatManagerDlg, RemoveBtnHdl)); + m_pBtnEdit->SetClickHdl(LINK(this, ScCondFormatManagerDlg, EditBtnHdl)); + m_pBtnAdd->SetClickHdl(LINK(this, ScCondFormatManagerDlg, AddBtnHdl)); + m_pCtrlManager->SetDoubleClickHdl(LINK(this, ScCondFormatManagerDlg, EditBtnHdl)); +} - maBtnRemove.SetClickHdl(LINK(this, ScCondFormatManagerDlg, RemoveBtnHdl)); - maBtnEdit.SetClickHdl(LINK(this, ScCondFormatManagerDlg, EditBtnHdl)); - maBtnAdd.SetClickHdl(LINK(this, ScCondFormatManagerDlg, AddBtnHdl)); - maCtrlManager.GetListControl().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; } bool ScCondFormatManagerDlg::IsInRefMode() const @@ -190,14 +182,14 @@ bool ScCondFormatManagerDlg::CondFormatsChanged() IMPL_LINK_NOARG(ScCondFormatManagerDlg, RemoveBtnHdl) { - maCtrlManager.DeleteSelection(); + m_pCtrlManager->DeleteSelection(); mbModified = true; return 0; } IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl) { - ScConditionalFormat* pFormat = maCtrlManager.GetSelection(); + ScConditionalFormat* pFormat = m_pCtrlManager->GetSelection(); if(!pFormat) return 0; @@ -219,7 +211,7 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl) mpFormatList->InsertNew(pNewFormat); } - maCtrlManager.Update(); + m_pCtrlManager->Update(); mbModified = true; } Show(true, 0); @@ -261,7 +253,7 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl) { mpFormatList->InsertNew(pNewFormat); pNewFormat->SetKey(FindKey(mpFormatList)); - maCtrlManager.Update(); + m_pCtrlManager->Update(); mbModified = true; } @@ -272,5 +264,4 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl) return 0; } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatmgr.hrc b/sc/source/ui/inc/condformatmgr.hrc deleted file mode 100644 index 7fb10c7f0e9d..000000000000 --- a/sc/source/ui/inc/condformatmgr.hrc +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#define BTN_OK 1 -#define BTN_CANCEL 2 -#define BTN_ADD 3 -#define BTN_REMOVE 4 -#define BTN_EDIT 5 -#define FL_LINE 6 -#define CTRL_TABLE 8 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatmgr.hxx b/sc/source/ui/inc/condformatmgr.hxx index 51719eae8f80..488f6c66810d 100644 --- a/sc/source/ui/inc/condformatmgr.hxx +++ b/sc/source/ui/inc/condformatmgr.hxx @@ -13,6 +13,7 @@ #include "sc.hrc" #include <vcl/dialog.hxx> +#include <vcl/layout.hxx> #include <svtools/svtabbx.hxx> #include <vcl/button.hxx> #include <vcl/fixed.hxx> @@ -38,27 +39,14 @@ private: DECL_LINK( HeaderEndDragHdl, void* ); public: - ScCondFormatManagerWindow( Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList ); + ScCondFormatManagerWindow( Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList); + void ChangeSize(Size aSize); void DeleteSelection(); ScConditionalFormat* GetSelection(); void Update(); }; -class ScCondFormatManagerCtrl : Control -{ -public: - ScCondFormatManagerCtrl(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList); - - ScConditionalFormat* GetSelection(); - void DeleteSelection(); - void Update(); - ScCondFormatManagerWindow &GetListControl() { return maWdManager; } - -private: - ScCondFormatManagerWindow maWdManager; -}; - class ScCondFormatManagerDlg : public ModalDialog { public: @@ -72,18 +60,13 @@ public: virtual bool IsInRefMode() const; private: - PushButton maBtnAdd; - PushButton maBtnRemove; - PushButton maBtnEdit; - - OKButton maBtnOk; - CancelButton maBtnCancel; - - FixedLine maFlLine; - + PushButton *m_pBtnAdd; + PushButton *m_pBtnRemove; + PushButton *m_pBtnEdit; ScConditionalFormatList* mpFormatList; - - ScCondFormatManagerCtrl maCtrlManager; + Window *m_pContainer; + VclVBox *m_pGrid; + ScCondFormatManagerWindow *m_pCtrlManager; ScDocument* mpDoc; ScAddress maPos; @@ -92,6 +75,8 @@ private: DECL_LINK(EditBtnHdl, void*); DECL_LINK(AddBtnHdl, void*); + virtual void Resize(); + bool mbModified; }; diff --git a/sc/source/ui/src/condformatmgr.src b/sc/source/ui/src/condformatmgr.src deleted file mode 100644 index 035d736eb0f4..000000000000 --- a/sc/source/ui/src/condformatmgr.src +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include "sc.hrc" -#include "condformatmgr.hrc" - -ModalDialog RID_SCDLG_COND_FORMAT_MANAGER -{ - HelpID = "sc:ModalDialog:RID_SCDLG_COND_FORMAT_MANAGER"; - OutputSize = TRUE; - Hide = TRUE; - Size = MAP_APPFONT ( 300, 275 ); - Text [ en-US ] = "Manage Conditional Formatting"; - Moveable = TRUE; - Closeable = TRUE; - OkButton BTN_OK - { - Pos = MAP_APPFONT ( 190, 255 ); - Size = MAP_APPFONT ( 50, 14 ); - TabStop = TRUE; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 245, 255 ); - Size = MAP_APPFONT ( 50, 14 ); - TabStop = TRUE; - }; - PushButton BTN_ADD - { - Pos = MAP_APPFONT( 5, 230 ); - Size = MAP_APPFONT( 40, 14 ); - Text [ en-US ] = "Add"; - TabStop = TRUE; - }; - PushButton BTN_REMOVE - { - Pos = MAP_APPFONT( 95, 230 ); - Size = MAP_APPFONT( 40, 14 ); - Text [ en-US ] = "Remove"; - TabStop = TRUE; - }; - Control CTRL_TABLE - { - Pos = MAP_APPFONT( 5, 5 ); - Size = MAP_APPFONT( 290, 220 ); - Border = TRUE; - }; - PushButton BTN_EDIT - { - Pos = MAP_APPFONT( 50, 230 ); - Size = MAP_APPFONT( 40, 14 ); - Text [ en-US ] = "Edit..."; - }; - FixedLine FL_LINE - { - Pos = MAP_APPFONT( 0, 250 ); - Size = MAP_APPFONT( 300, 2 ); - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/uiconfig/scalc/ui/condformatmanager.ui b/sc/uiconfig/scalc/ui/condformatmanager.ui new file mode 100644 index 000000000000..24bf873fc98a --- /dev/null +++ b/sc/uiconfig/scalc/ui/condformatmanager.ui @@ -0,0 +1,157 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="CondFormatManager"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Manage Conditional Formatting</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <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="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="HELP"> + <property name="label">gtk-help</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> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkButtonBox" id="buttonbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">6</property> + <property name="layout_style">start</property> + <child> + <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> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <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> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <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> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkDrawingArea" id="CONTAINER"> + <property name="width_request">300</property> + <property name="height_request">200</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">OK</action-widget> + <action-widget response="0">HELP</action-widget> + </action-widgets> + </object> +</interface> |