Kaydet (Commit) 471e5c1e authored tarafından Csikós Tamás's avatar Csikós Tamás Kaydeden (comit) Caolán McNamara

modern .ui widgetlayout for directsql

Change-Id: I51140fe6abd2d321c5784b923f920ab9183f417e
Reviewed-on: https://gerrit.libreoffice.org/5171Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d7b48d03
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
$(eval $(call gb_UIConfig_UIConfig,dbaccess)) $(eval $(call gb_UIConfig_UIConfig,dbaccess))
$(eval $(call gb_UIConfig_add_uifiles,dbaccess, \ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/directsqldialog \
dbaccess/uiconfig/ui/querypropertiesdialog \ dbaccess/uiconfig/ui/querypropertiesdialog \
dbaccess/uiconfig/ui/generalpagedialog \ dbaccess/uiconfig/ui/generalpagedialog \
dbaccess/uiconfig/ui/generalpagewizard \ dbaccess/uiconfig/ui/generalpagewizard \
......
...@@ -73,33 +73,25 @@ namespace dbaui ...@@ -73,33 +73,25 @@ namespace dbaui
DBG_NAME(DirectSQLDialog) DBG_NAME(DirectSQLDialog)
//-------------------------------------------------------------------- //--------------------------------------------------------------------
DirectSQLDialog::DirectSQLDialog( Window* _pParent, const Reference< XConnection >& _rxConn ) DirectSQLDialog::DirectSQLDialog( Window* _pParent, const Reference< XConnection >& _rxConn )
:ModalDialog(_pParent, ModuleRes(DLG_DIRECTSQL)) :ModalDialog(_pParent, "DirectSQLDialog" , "dbaccess/ui/directsqldialog.ui")
,m_aFrame (this, ModuleRes(FL_SQL))
,m_aSQLLabel (this, ModuleRes(FT_SQL))
,m_aSQL (this, ModuleRes(ME_SQL))
,m_aExecute (this, ModuleRes(PB_EXECUTE))
,m_aHistoryLabel (this, ModuleRes(FT_HISTORY))
,m_pSQLHistory(new LargeEntryListBox(this, ModuleRes(LB_HISTORY)))
,m_aStatusFrame (this, ModuleRes(FL_STATUS))
,m_aStatus (this, ModuleRes(ME_STATUS))
,m_pShowOutput(new CheckBox(this, ModuleRes(CB_SHOWOUTPUT)))
,m_aOutputFrame (this, ModuleRes(FL_OUTPUT))
,m_aOutput (this, ModuleRes(ME_OUTPUT))
,m_aButtonSeparator (this, ModuleRes(FL_BUTTONS))
,m_aHelp (this, ModuleRes(PB_HELP))
,m_aClose (this, ModuleRes(PB_CLOSE))
,m_nHistoryLimit(20) ,m_nHistoryLimit(20)
,m_nStatusCount(1) ,m_nStatusCount(1)
,m_xConnection(_rxConn) ,m_xConnection(_rxConn)
{ {
DBG_CTOR(DirectSQLDialog,NULL); get(m_pSQL,"sql");
get(m_pExecute,"execute");
get(m_pSQLHistory,"sqlhistory");
get(m_pStatus,"status");
get(m_pShowOutput,"showoutput");
get(m_pOutput,"output");
get(m_pClose,"close");
FreeResource(); DBG_CTOR(DirectSQLDialog,NULL);
m_aSQL.GrabFocus(); m_pSQL->GrabFocus();
m_aExecute.SetClickHdl(LINK(this, DirectSQLDialog, OnExecute)); m_pExecute->SetClickHdl(LINK(this, DirectSQLDialog, OnExecute));
m_aClose.SetClickHdl(LINK(this, DirectSQLDialog, OnClose)); m_pClose->SetClickHdl(LINK(this, DirectSQLDialog, OnClose));
m_pSQLHistory->SetSelectHdl(LINK(this, DirectSQLDialog, OnListEntrySelected)); m_pSQLHistory->SetSelectHdl(LINK(this, DirectSQLDialog, OnListEntrySelected));
m_pSQLHistory->SetDropDownLineCount(10); m_pSQLHistory->SetDropDownLineCount(10);
...@@ -109,8 +101,8 @@ DBG_NAME(DirectSQLDialog) ...@@ -109,8 +101,8 @@ DBG_NAME(DirectSQLDialog)
if (xConnComp.is()) if (xConnComp.is())
startComponentListening(xConnComp); startComponentListening(xConnComp);
m_aSQL.SetModifyHdl(LINK(this, DirectSQLDialog, OnStatementModified)); m_pSQL->SetModifyHdl(LINK(this, DirectSQLDialog, OnStatementModified));
OnStatementModified(&m_aSQL); OnStatementModified(m_pSQL);
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
...@@ -120,8 +112,6 @@ DBG_NAME(DirectSQLDialog) ...@@ -120,8 +112,6 @@ DBG_NAME(DirectSQLDialog)
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
stopAllComponentListening(); stopAllComponentListening();
} }
delete m_pSQLHistory;
delete m_pShowOutput;
DBG_DTOR(DirectSQLDialog,NULL); DBG_DTOR(DirectSQLDialog,NULL);
} }
...@@ -226,7 +216,7 @@ DBG_NAME(DirectSQLDialog) ...@@ -226,7 +216,7 @@ DBG_NAME(DirectSQLDialog)
OSL_ENSURE(xStatement.is(), "DirectSQLDialog::implExecuteStatement: no statement returned by the connection!"); OSL_ENSURE(xStatement.is(), "DirectSQLDialog::implExecuteStatement: no statement returned by the connection!");
// clear the output box // clear the output box
m_aOutput.SetText(OUString()); m_pOutput->SetText(OUString());
if (xStatement.is()) if (xStatement.is())
{ {
if (OUString(_rStatement).toAsciiUpperCase().startsWith("SELECT") && m_pShowOutput->IsChecked()) if (OUString(_rStatement).toAsciiUpperCase().startsWith("SELECT") && m_pShowOutput->IsChecked())
...@@ -288,10 +278,10 @@ DBG_NAME(DirectSQLDialog) ...@@ -288,10 +278,10 @@ DBG_NAME(DirectSQLDialog)
{ {
OUString sAppendMessage = OUString::number(m_nStatusCount++) + ": " + _rMessage + "\n\n"; OUString sAppendMessage = OUString::number(m_nStatusCount++) + ": " + _rMessage + "\n\n";
OUString sCompleteMessage = m_aStatus.GetText() + sAppendMessage; OUString sCompleteMessage = m_pStatus->GetText() + sAppendMessage;
m_aStatus.SetText(sCompleteMessage); m_pStatus->SetText(sCompleteMessage);
m_aStatus.SetSelection(Selection(sCompleteMessage.getLength(), sCompleteMessage.getLength())); m_pStatus->SetSelection(Selection(sCompleteMessage.getLength(), sCompleteMessage.getLength()));
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
...@@ -300,9 +290,9 @@ DBG_NAME(DirectSQLDialog) ...@@ -300,9 +290,9 @@ DBG_NAME(DirectSQLDialog)
String sAppendMessage = _rMessage; String sAppendMessage = _rMessage;
sAppendMessage += OUString("\n"); sAppendMessage += OUString("\n");
String sCompleteMessage = m_aOutput.GetText(); String sCompleteMessage = m_pOutput->GetText();
sCompleteMessage += sAppendMessage; sCompleteMessage += sAppendMessage;
m_aOutput.SetText(sCompleteMessage); m_pOutput->SetText(sCompleteMessage);
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
...@@ -310,7 +300,7 @@ DBG_NAME(DirectSQLDialog) ...@@ -310,7 +300,7 @@ DBG_NAME(DirectSQLDialog)
{ {
CHECK_INVARIANTS("DirectSQLDialog::executeCurrent"); CHECK_INVARIANTS("DirectSQLDialog::executeCurrent");
String sStatement = m_aSQL.GetText(); String sStatement = m_pSQL->GetText();
// execute // execute
implExecuteStatement(sStatement); implExecuteStatement(sStatement);
...@@ -318,8 +308,8 @@ DBG_NAME(DirectSQLDialog) ...@@ -318,8 +308,8 @@ DBG_NAME(DirectSQLDialog)
// add the statement to the history // add the statement to the history
implAddToStatementHistory(sStatement); implAddToStatementHistory(sStatement);
m_aSQL.SetSelection(Selection()); m_pSQL->SetSelection(Selection());
m_aSQL.GrabFocus(); m_pSQL->GrabFocus();
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
...@@ -331,8 +321,8 @@ DBG_NAME(DirectSQLDialog) ...@@ -331,8 +321,8 @@ DBG_NAME(DirectSQLDialog)
{ {
// set the text in the statement editor // set the text in the statement editor
String sStatement = m_aStatementHistory[_nHistoryPos]; String sStatement = m_aStatementHistory[_nHistoryPos];
m_aSQL.SetText(sStatement); m_pSQL->SetText(sStatement);
OnStatementModified(&m_aSQL); OnStatementModified(m_pSQL);
if (_bUpdateListBox) if (_bUpdateListBox)
{ {
...@@ -342,8 +332,8 @@ DBG_NAME(DirectSQLDialog) ...@@ -342,8 +332,8 @@ DBG_NAME(DirectSQLDialog)
"DirectSQLDialog::switchToHistory: inconsistent listbox entries!"); "DirectSQLDialog::switchToHistory: inconsistent listbox entries!");
} }
m_aSQL.GrabFocus(); m_pSQL->GrabFocus();
m_aSQL.SetSelection(Selection(sStatement.Len(), sStatement.Len())); m_pSQL->SetSelection(Selection(sStatement.Len(), sStatement.Len()));
} }
else else
OSL_FAIL("DirectSQLDialog::switchToHistory: invalid position!"); OSL_FAIL("DirectSQLDialog::switchToHistory: invalid position!");
...@@ -352,7 +342,7 @@ DBG_NAME(DirectSQLDialog) ...@@ -352,7 +342,7 @@ DBG_NAME(DirectSQLDialog)
//-------------------------------------------------------------------- //--------------------------------------------------------------------
IMPL_LINK( DirectSQLDialog, OnStatementModified, void*, /*NOTINTERESTEDIN*/ ) IMPL_LINK( DirectSQLDialog, OnStatementModified, void*, /*NOTINTERESTEDIN*/ )
{ {
m_aExecute.Enable(!m_aSQL.GetText().isEmpty()); m_pExecute->Enable(!m_pSQL->GetText().isEmpty());
return 0L; return 0L;
} }
......
...@@ -51,20 +51,14 @@ namespace dbaui ...@@ -51,20 +51,14 @@ namespace dbaui
OModuleClient m_aModuleClient; OModuleClient m_aModuleClient;
::osl::Mutex m_aMutex; ::osl::Mutex m_aMutex;
FixedLine m_aFrame; MultiLineEditSyntaxHighlight* m_pSQL;
FixedText m_aSQLLabel; PushButton* m_pExecute;
MultiLineEditSyntaxHighlight m_aSQL;
PushButton m_aExecute;
FixedText m_aHistoryLabel;
ListBox* m_pSQLHistory; ListBox* m_pSQLHistory;
FixedLine m_aStatusFrame; MultiLineEdit* m_pStatus;
MultiLineEdit m_aStatus;
CheckBox* m_pShowOutput; CheckBox* m_pShowOutput;
FixedLine m_aOutputFrame; MultiLineEdit* m_pOutput;
MultiLineEdit m_aOutput; HelpButton* m_pHelp;
FixedLine m_aButtonSeparator; PushButton* m_pClose;
HelpButton m_aHelp;
PushButton m_aClose;
typedef ::std::deque< String > StringQueue; typedef ::std::deque< String > StringQueue;
StringQueue m_aStatementHistory; // previous statements StringQueue m_aStatementHistory; // previous statements
......
This diff is collapsed.
...@@ -227,6 +227,12 @@ ...@@ -227,6 +227,12 @@
<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"
generic-name="MultiLineEdit" parent="GtkTextView"
icon-name="widget-gtk-textview"/>
<glade-widget-class title="ValueSet" name="svtlo-ValueSet" <glade-widget-class title="ValueSet" name="svtlo-ValueSet"
generic-name="Set of Value Options" parent="GtkDrawingArea" generic-name="Set of Value Options" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <svtools/svmedit.hxx> #include <svtools/svmedit.hxx>
#include <vcl/xtextedt.hxx> #include <vcl/xtextedt.hxx>
#include <vcl/builder.hxx>
#include <svtools/editsyntaxhighlighter.hxx> #include <svtools/editsyntaxhighlighter.hxx>
#include <vcl/txtattr.hxx> #include <vcl/txtattr.hxx>
...@@ -38,6 +39,11 @@ MultiLineEditSyntaxHighlight::MultiLineEditSyntaxHighlight( Window* pParent, con ...@@ -38,6 +39,11 @@ MultiLineEditSyntaxHighlight::MultiLineEditSyntaxHighlight( Window* pParent, con
aHighlighter.initialize( aLanguage ); aHighlighter.initialize( aLanguage );
} }
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeMultiLineEditSyntaxHighlight(Window *pParent, VclBuilder::stringmap &)
{
return new MultiLineEditSyntaxHighlight(pParent);
}
MultiLineEditSyntaxHighlight::~MultiLineEditSyntaxHighlight() MultiLineEditSyntaxHighlight::~MultiLineEditSyntaxHighlight()
{ {
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "unoiface.hxx" #include "unoiface.hxx"
#include <vcl/builder.hxx>
#include <svtools/textwindowpeer.hxx> #include <svtools/textwindowpeer.hxx>
...@@ -33,6 +34,11 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId ) ...@@ -33,6 +34,11 @@ 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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment