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
This commit is contained in:
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "directsql.hxx"
|
#include "directsql.hxx"
|
||||||
#include "directsql.hrc"
|
|
||||||
#include "dbu_dlg.hrc"
|
#include "dbu_dlg.hrc"
|
||||||
#include <vcl/msgbox.hxx>
|
#include <vcl/msgbox.hxx>
|
||||||
#include <comphelper/types.hxx>
|
#include <comphelper/types.hxx>
|
||||||
@@ -79,11 +78,18 @@ DBG_NAME(DirectSQLDialog)
|
|||||||
,m_xConnection(_rxConn)
|
,m_xConnection(_rxConn)
|
||||||
{
|
{
|
||||||
get(m_pSQL,"sql");
|
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_pExecute,"execute");
|
||||||
get(m_pSQLHistory,"sqlhistory");
|
get(m_pSQLHistory,"sqlhistory");
|
||||||
get(m_pStatus,"status");
|
get(m_pStatus,"status");
|
||||||
|
aSize = m_pStatus->CalcSize(60, 5);
|
||||||
|
m_pStatus->set_height_request(aSize.Height());
|
||||||
get(m_pShowOutput,"showoutput");
|
get(m_pShowOutput,"showoutput");
|
||||||
get(m_pOutput,"output");
|
get(m_pOutput,"output");
|
||||||
|
aSize = m_pOutput->CalcSize(60, 5);
|
||||||
|
m_pOutput->set_height_request(aSize.Height());
|
||||||
get(m_pClose,"close");
|
get(m_pClose,"close");
|
||||||
|
|
||||||
DBG_CTOR(DirectSQLDialog,NULL);
|
DBG_CTOR(DirectSQLDialog,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: */
|
|
@@ -17,126 +17,8 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "directsql.hrc"
|
|
||||||
#include "dbu_dlg.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
|
String STR_COMMAND_EXECUTED_SUCCESSFULLY
|
||||||
{
|
{
|
||||||
Text [ en-US ] = "Command successfully executed." ;
|
Text [ en-US ] = "Command successfully executed." ;
|
||||||
|
@@ -95,7 +95,7 @@
|
|||||||
#define DLG_INDEXDESIGN RID_DIALOG_START + 19
|
#define DLG_INDEXDESIGN RID_DIALOG_START + 19
|
||||||
// FREE
|
// FREE
|
||||||
#define DLG_DATABASE_USERADMIN RID_DIALOG_START + 21
|
#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_PASSWORD RID_DIALOG_START + 23
|
||||||
#define DLG_DOMAINPASSWORD RID_DIALOG_START + 24
|
#define DLG_DOMAINPASSWORD RID_DIALOG_START + 24
|
||||||
#define DLG_DATABASE_ADVANCED RID_DIALOG_START + 26
|
#define DLG_DATABASE_ADVANCED RID_DIALOG_START + 26
|
||||||
|
@@ -52,13 +52,13 @@ namespace dbaui
|
|||||||
::osl::Mutex m_aMutex;
|
::osl::Mutex m_aMutex;
|
||||||
|
|
||||||
MultiLineEditSyntaxHighlight* m_pSQL;
|
MultiLineEditSyntaxHighlight* m_pSQL;
|
||||||
PushButton* m_pExecute;
|
PushButton* m_pExecute;
|
||||||
ListBox* m_pSQLHistory;
|
ListBox* m_pSQLHistory;
|
||||||
MultiLineEdit* m_pStatus;
|
VclMultiLineEdit* m_pStatus;
|
||||||
CheckBox* m_pShowOutput;
|
CheckBox* m_pShowOutput;
|
||||||
MultiLineEdit* m_pOutput;
|
VclMultiLineEdit* m_pOutput;
|
||||||
HelpButton* m_pHelp;
|
HelpButton* m_pHelp;
|
||||||
PushButton* m_pClose;
|
PushButton* m_pClose;
|
||||||
|
|
||||||
typedef ::std::deque< String > StringQueue;
|
typedef ::std::deque< String > StringQueue;
|
||||||
StringQueue m_aStatementHistory; // previous statements
|
StringQueue m_aStatementHistory; // previous statements
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<!-- interface-requires gtk+ 3.0 -->
|
<!-- interface-requires gtk+ 3.0 -->
|
||||||
|
<!-- interface-requires LibreOffice 1.0 -->
|
||||||
<object class="GtkDialog" id="DirectSQLDialog">
|
<object class="GtkDialog" id="DirectSQLDialog">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="border_width">6</property>
|
<property name="border_width">6</property>
|
||||||
@@ -36,7 +37,6 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="can_default">True</property>
|
<property name="can_default">True</property>
|
||||||
<property name="has_default">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use_stock">True</property>
|
||||||
</object>
|
</object>
|
||||||
@@ -126,6 +126,8 @@
|
|||||||
<property name="label">_Execute</property>
|
<property name="label">_Execute</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">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="receives_default">True</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
</object>
|
</object>
|
||||||
@@ -145,9 +147,10 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkComboBox" id="sqlhistory">
|
<object class="VclComboBoxText" id="sqlhistory">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="max_width_chars">60</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
@@ -206,9 +209,18 @@
|
|||||||
<property name="top_padding">6</property>
|
<property name="top_padding">6</property>
|
||||||
<property name="left_padding">12</property>
|
<property name="left_padding">12</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="svtlo-MultiLineEdit" id="status:border">
|
<object class="GtkScrolledWindow" id="scrolledwindow2">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">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>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@@ -243,9 +255,19 @@
|
|||||||
<property name="top_padding">6</property>
|
<property name="top_padding">6</property>
|
||||||
<property name="left_padding">12</property>
|
<property name="left_padding">12</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="svtlo-MultiLineEdit" id="output:border">
|
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">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>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
@@ -227,9 +227,6 @@
|
|||||||
<glade-widget-class title="Frame Selector" name="svxlo-SvxFrameSelector"
|
<glade-widget-class title="Frame Selector" name="svxlo-SvxFrameSelector"
|
||||||
generic-name="Frame Border Preview Window" parent="GtkDrawingArea"
|
generic-name="Frame Border Preview Window" parent="GtkDrawingArea"
|
||||||
icon-name="widget-gtk-drawingarea"/>
|
icon-name="widget-gtk-drawingarea"/>
|
||||||
<glade-widget-class title="MultiLine Edit" name="svtlo-MultiLineEdit"
|
|
||||||
generic-name="MultiLineEdit" parent="GtkTextView"
|
|
||||||
icon-name="widget-gtk-textview"/>
|
|
||||||
<glade-widget-class title="MultiLine Edit" name="svtlo-MultiLineEditSyntaxHighlight"
|
<glade-widget-class title="MultiLine Edit" name="svtlo-MultiLineEditSyntaxHighlight"
|
||||||
generic-name="MultiLineEdit" parent="GtkTextView"
|
generic-name="MultiLineEdit" parent="GtkTextView"
|
||||||
icon-name="widget-gtk-textview"/>
|
icon-name="widget-gtk-textview"/>
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "unoiface.hxx"
|
#include "unoiface.hxx"
|
||||||
#include <vcl/builder.hxx>
|
|
||||||
#include <svtools/textwindowpeer.hxx>
|
#include <svtools/textwindowpeer.hxx>
|
||||||
|
|
||||||
|
|
||||||
@@ -34,11 +33,6 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeMultiLineEdit(Window *pParent, VclBuilder::stringmap &)
|
|
||||||
{
|
|
||||||
return new MultiLineEdit(pParent);
|
|
||||||
}
|
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
css::uno::Reference< css::awt::XWindowPeer >
|
css::uno::Reference< css::awt::XWindowPeer >
|
||||||
MultiLineEdit::GetComponentInterface(sal_Bool bCreate)
|
MultiLineEdit::GetComponentInterface(sal_Bool bCreate)
|
||||||
|
Reference in New Issue
Block a user