diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-07-30 14:24:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-30 14:51:47 +0100 |
commit | ab29ad8cd537cd77d4124801b714c75062e1e5dd (patch) | |
tree | 75ddc4dae9b4422bd77652d6c55655fb111dde5a /dbaccess | |
parent | modern .ui widgetlayout for directsql (diff) | |
download | core-ab29ad8cd537cd77d4124801b714c75062e1e5dd.tar.gz core-ab29ad8cd537cd77d4124801b714c75062e1e5dd.zip |
set some initial sizes for the direct sql dialog textedits
and we can use existing GtkTextView<->VclMultiLineEdit mapping rather than the
svtools MultiLineEdit
Change-Id: I6d20a9ba8731dda1ec9579fc2877b817fea0632f
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/dlg/directsql.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/directsql.hrc | 40 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/directsql.src | 118 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_resource.hrc | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/directsql.hxx | 14 | ||||
-rw-r--r-- | dbaccess/uiconfig/ui/directsqldialog.ui | 30 |
6 files changed, 41 insertions, 171 deletions
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index 87b917321970..91cb646c0cdb 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -19,7 +19,6 @@ #include "directsql.hxx" -#include "directsql.hrc" #include "dbu_dlg.hrc" #include <vcl/msgbox.hxx> #include <comphelper/types.hxx> @@ -79,11 +78,18 @@ DBG_NAME(DirectSQLDialog) ,m_xConnection(_rxConn) { get(m_pSQL,"sql"); + Size aSize(m_pSQL->CalcSize(60, 7)); + m_pSQL->set_width_request(aSize.Width()); + m_pSQL->set_height_request(aSize.Height()); get(m_pExecute,"execute"); get(m_pSQLHistory,"sqlhistory"); get(m_pStatus,"status"); + aSize = m_pStatus->CalcSize(60, 5); + m_pStatus->set_height_request(aSize.Height()); get(m_pShowOutput,"showoutput"); get(m_pOutput,"output"); + aSize = m_pOutput->CalcSize(60, 5); + m_pOutput->set_height_request(aSize.Height()); get(m_pClose,"close"); DBG_CTOR(DirectSQLDialog,NULL); diff --git a/dbaccess/source/ui/dlg/directsql.hrc b/dbaccess/source/ui/dlg/directsql.hrc deleted file mode 100644 index 7d500135f692..000000000000 --- a/dbaccess/source/ui/dlg/directsql.hrc +++ /dev/null @@ -1,40 +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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef _DBACCESS_UI_DIRECTSQL_HRC_ -#define _DBACCESS_UI_DIRECTSQL_HRC_ - -#define FL_SQL 1 -#define FT_SQL 2 -#define ME_SQL 3 -#define PB_EXECUTE 4 -#define FT_HISTORY 5 -#define LB_HISTORY 6 -#define FL_STATUS 7 -#define ME_STATUS 8 -#define FL_BUTTONS 9 -#define PB_HELP 10 -#define PB_CLOSE 11 -#define CB_SHOWOUTPUT 12 -#define FL_OUTPUT 13 -#define ME_OUTPUT 14 - -#endif // _DBACCESS_UI_DIRECTSQL_HRC_ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/directsql.src b/dbaccess/source/ui/dlg/directsql.src index 230bd67e33c6..8bb0ed1633c0 100644 --- a/dbaccess/source/ui/dlg/directsql.src +++ b/dbaccess/source/ui/dlg/directsql.src @@ -17,126 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "directsql.hrc" #include "dbu_dlg.hrc" -#define BUTTON_SIZE_X 50 -#define BUTTON_SIZE_Y 14 - -#define WINDOW_SIZE_X 200 -#define WINDOW_SIZE_Y 255 + BUTTON_SIZE_Y + BUTTON_SIZE_Y - -ModalDialog DLG_DIRECTSQL -{ - HelpID = "dbaccess:ModalDialog:DLG_DIRECTSQL"; - OutputSize = TRUE ; - Moveable = TRUE ; - Closeable = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ; - - FixedLine FL_SQL - { - Pos = MAP_APPFONT( 4, 3 ); - Size = MAP_APPFONT( WINDOW_SIZE_X - 8, 8 ); - Text [ en-US ] = "SQL command"; - }; - FixedText FT_SQL - { - Pos = MAP_APPFONT( 7, 15 ); - Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 8 ); - Text [ en-US ] = "Command to execute"; - }; - MultiLineEdit ME_SQL - { - HelpID = "dbaccess:MultiLineEdit:DLG_DIRECTSQL:ME_SQL"; - Pos = MAP_APPFONT( 7, 26 ); - Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 60 ); - SVLook = TRUE; - Border = TRUE; - TabStop = TRUE; - IgnoreTab = TRUE; - }; - CheckBox CB_SHOWOUTPUT - { - Pos = MAP_APPFONT( 7, 89 ); - Size = MAP_APPFONT( 120, 10 ); - Text [ en-US ] = "Show output of \"select\" statements"; - }; - PushButton PB_EXECUTE - { - HelpID = "dbaccess:PushButton:DLG_DIRECTSQL:PB_EXECUTE"; - Pos = MAP_APPFONT( WINDOW_SIZE_X - BUTTON_SIZE_X - 7, 89 ); - Size = MAP_APPFONT( BUTTON_SIZE_X, BUTTON_SIZE_Y ); - Text [ en-US ] = "Execute"; - DefButton = TRUE; - }; - FixedText FT_HISTORY - { - Pos = MAP_APPFONT( 7, 85 + BUTTON_SIZE_Y + 3 ); - Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 8 ); - Text [ en-US ] = "Previous commands"; - }; - ListBox LB_HISTORY - { - HelpID = "dbaccess:ListBox:DLG_DIRECTSQL:LB_HISTORY"; - Pos = MAP_APPFONT( 7, 96 + BUTTON_SIZE_Y + 3 ); - Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 14 ); - SvLook = TRUE; - DropDown = TRUE; - Border = TRUE; - }; - FixedLine FL_STATUS - { - Pos = MAP_APPFONT( 4, 113 + BUTTON_SIZE_Y + 4 ); - Size = MAP_APPFONT( WINDOW_SIZE_X - 8, 8 ); - Text [ en-US ] = "Status"; - }; - MultiLineEdit ME_STATUS - { - HelpID = "dbaccess:MultiLineEdit:DLG_DIRECTSQL:ME_STATUS"; - Pos = MAP_APPFONT( 7, 128 + BUTTON_SIZE_Y ); - Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 41 ); - Border = TRUE; - ReadOnly = TRUE; - VScroll = TRUE; - }; - FixedLine FL_OUTPUT - { - Pos = MAP_APPFONT( 4, 173 + BUTTON_SIZE_Y + 4 ); - Size = MAP_APPFONT( WINDOW_SIZE_X - 8, 8 ); - Text [ en-US ] = "Output"; - }; - MultiLineEdit ME_OUTPUT - { - Pos = MAP_APPFONT( 7, 188 + BUTTON_SIZE_Y ); - Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 51 ); - Border = TRUE; - ReadOnly = TRUE; - VScroll = TRUE; - HScroll = TRUE; - }; - FixedLine FL_BUTTONS - { - Pos = MAP_APPFONT( 4, 238 + BUTTON_SIZE_Y + 4 ); - Size = MAP_APPFONT( WINDOW_SIZE_X - 8, 8 ); - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT( WINDOW_SIZE_X - 7 - BUTTON_SIZE_X - 3 - BUTTON_SIZE_X, 252 + BUTTON_SIZE_Y ); - Size = MAP_APPFONT( BUTTON_SIZE_X, BUTTON_SIZE_Y ); - }; - PushButton PB_CLOSE - { - HelpID = "dbaccess:PushButton:DLG_DIRECTSQL:PB_CLOSE"; - Pos = MAP_APPFONT( WINDOW_SIZE_X - 7 - BUTTON_SIZE_X, 252 + BUTTON_SIZE_Y ); - Size = MAP_APPFONT( BUTTON_SIZE_X, BUTTON_SIZE_Y ); - Text [ en-US ] = "Close"; - }; - - Text [ en-US ] = "Execute SQL Statement" ; -}; - String STR_COMMAND_EXECUTED_SUCCESSFULLY { Text [ en-US ] = "Command successfully executed." ; diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index f5333afa2be9..e9d1eb0aab7e 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -95,7 +95,7 @@ #define DLG_INDEXDESIGN RID_DIALOG_START + 19 // FREE #define DLG_DATABASE_USERADMIN RID_DIALOG_START + 21 -#define DLG_DIRECTSQL RID_DIALOG_START + 22 + // FREE #define DLG_PASSWORD RID_DIALOG_START + 23 #define DLG_DOMAINPASSWORD RID_DIALOG_START + 24 #define DLG_DATABASE_ADVANCED RID_DIALOG_START + 26 diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx index 3b59d315859b..3876bf4d3c37 100644 --- a/dbaccess/source/ui/inc/directsql.hxx +++ b/dbaccess/source/ui/inc/directsql.hxx @@ -52,13 +52,13 @@ namespace dbaui ::osl::Mutex m_aMutex; MultiLineEditSyntaxHighlight* m_pSQL; - PushButton* m_pExecute; - ListBox* m_pSQLHistory; - MultiLineEdit* m_pStatus; - CheckBox* m_pShowOutput; - MultiLineEdit* m_pOutput; - HelpButton* m_pHelp; - PushButton* m_pClose; + PushButton* m_pExecute; + ListBox* m_pSQLHistory; + VclMultiLineEdit* m_pStatus; + CheckBox* m_pShowOutput; + VclMultiLineEdit* m_pOutput; + HelpButton* m_pHelp; + PushButton* m_pClose; typedef ::std::deque< String > StringQueue; StringQueue m_aStatementHistory; // previous statements diff --git a/dbaccess/uiconfig/ui/directsqldialog.ui b/dbaccess/uiconfig/ui/directsqldialog.ui index b4ac7ec3b987..ccb86c431a21 100644 --- a/dbaccess/uiconfig/ui/directsqldialog.ui +++ b/dbaccess/uiconfig/ui/directsqldialog.ui @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <!-- interface-requires gtk+ 3.0 --> + <!-- interface-requires LibreOffice 1.0 --> <object class="GtkDialog" id="DirectSQLDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> @@ -36,7 +37,6 @@ <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_stock">True</property> </object> @@ -126,6 +126,8 @@ <property name="label">_Execute</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_underline">True</property> </object> @@ -145,9 +147,10 @@ </packing> </child> <child> - <object class="GtkComboBox" id="sqlhistory"> + <object class="VclComboBoxText" id="sqlhistory"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="max_width_chars">60</property> </object> <packing> <property name="left_attach">0</property> @@ -206,9 +209,18 @@ <property name="top_padding">6</property> <property name="left_padding">12</property> <child> - <object class="svtlo-MultiLineEdit" id="status:border"> + <object class="GtkScrolledWindow" id="scrolledwindow2"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="vscrollbar_policy">always</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTextView" id="status:border"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + </object> + </child> </object> </child> </object> @@ -243,9 +255,19 @@ <property name="top_padding">6</property> <property name="left_padding">12</property> <child> - <object class="svtlo-MultiLineEdit" id="output:border"> + <object class="GtkScrolledWindow" id="scrolledwindow1"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="hscrollbar_policy">always</property> + <property name="vscrollbar_policy">always</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTextView" id="output:border"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + </object> + </child> </object> </child> </object> |