SVN Commit by dpage: r4651 - in trunk/pgadmin3/src: frm include - Mailing list pgadmin-hackers

From svn@pgadmin.org
Subject SVN Commit by dpage: r4651 - in trunk/pgadmin3/src: frm include
Date
Msg-id 200511041458.jA4EwjUv017270@developer.pgadmin.org
Whole thread Raw
List pgadmin-hackers
Author: dpage
Date: 2005-11-04 14:58:44 +0000 (Fri, 04 Nov 2005)
New Revision: 4651

Modified:
   trunk/pgadmin3/src/frm/frmQuery.cpp
   trunk/pgadmin3/src/include/frmQuery.h
Log:
Replace the query tool margin line numbers with a new panel in the status bar

Modified: trunk/pgadmin3/src/frm/frmQuery.cpp
===================================================================
--- trunk/pgadmin3/src/frm/frmQuery.cpp    2005-11-04 13:34:03 UTC (rev 4650)
+++ trunk/pgadmin3/src/frm/frmQuery.cpp    2005-11-04 14:58:44 UTC (rev 4651)
@@ -74,6 +74,7 @@
     EVT_MENU(MNU_SAVEHISTORY,       frmQuery::OnSaveHistory)
     EVT_ACTIVATE(                   frmQuery::OnActivate)
     EVT_STC_MODIFIED(CTL_SQLQUERY,  frmQuery::OnChangeStc)
+    EVT_STC_UPDATEUI(CTL_SQLQUERY,  frmQuery::OnPositionStc)
 END_EVENT_TABLE()


@@ -171,10 +172,10 @@

     queryMenu->Enable(MNU_CANCEL, false);

-    int iWidths[4] = {0, -1, 110, 110};
-    statusBar=CreateStatusBar(4);
+    int iWidths[5] = {0, -1, 110, 110, 110};
+    statusBar=CreateStatusBar(5);
     SetStatusBarPane(-1);
-    SetStatusWidths(4, iWidths);
+    SetStatusWidths(5, iWidths);
     SetStatusText(_("ready"), STATUSPOS_MSGS);

     toolBar = CreateToolBar();
@@ -212,8 +213,7 @@
     horizontal->SetMinimumPaneSize(50);

     sqlQuery = new ctlSQLBox(horizontal, CTL_SQLQUERY, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE |
wxSIMPLE_BORDER| wxTE_RICH2); 
-    sqlQuery->SetMarginWidth(1, 50);
-    sqlQuery->SetMarginType(1, 1);
+    sqlQuery->SetMarginWidth(1, 16);

     output = new wxNotebook(horizontal, -1, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM);
     sqlResult = new ctlSQLResult(output, conn, CTL_SQLRESULT, wxDefaultPosition, wxDefaultSize);
@@ -782,7 +782,14 @@
     }
 }

+void frmQuery::OnPositionStc(wxStyledTextEvent& event)
+{
+    wxString pos;
+    pos.Printf(_("Ln %d Col %d"), sqlQuery->LineFromPosition(sqlQuery->GetCurrentPos()) + 1,
sqlQuery->GetColumn(sqlQuery->GetCurrentPos())+ 1); 
+    SetStatusText(pos, STATUSPOS_POS);
+}

+
 void frmQuery::OpenLastFile()
 {
     wxString str=FileRead(lastPath);

Modified: trunk/pgadmin3/src/include/frmQuery.h
===================================================================
--- trunk/pgadmin3/src/include/frmQuery.h    2005-11-04 13:34:03 UTC (rev 4650)
+++ trunk/pgadmin3/src/include/frmQuery.h    2005-11-04 14:58:44 UTC (rev 4651)
@@ -39,6 +39,7 @@
     wxLongLong elapsedQuery, elapsedRetrieve;

     void OnChangeStc(wxStyledTextEvent& event);
+    void OnPositionStc(wxStyledTextEvent& event);
     void OnClose(wxCloseEvent& event);
     void OnSetFocus(wxFocusEvent& event);
     void OnContents(wxCommandEvent& event);
@@ -88,6 +89,7 @@
 enum
 {
     STATUSPOS_MSGS = 1,
+    STATUSPOS_POS,
     STATUSPOS_ROWS,
     STATUSPOS_SECS
 };


pgadmin-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: Query tool margin
Next
From: svn@pgadmin.org
Date:
Subject: SVN Commit by andreas: r4652 - in trunk/pgadmin3/docs/fr_FR: . hints