Unix Technical Forum

More data edit grid fixes

This is a discussion on More data edit grid fixes within the pgsql Interfaces Pgadmin Hackers forums, part of the PostgreSQL category; --> Here's two more minor fixes to the edit data grid. First is related to the copy changes I recently ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces Pgadmin Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 06:58 PM
Edward Di Geronimo Jr.
 
Posts: n/a
Default More data edit grid fixes

Here's two more minor fixes to the edit data grid.

First is related to the copy changes I recently made. Since I modified
the code to copy the cell the cursor is on if there is no highlight,
this change makes the Copy button in the toolbar enabled at all times.

The other is related to editing text cells. It looks like someone
half-implemented a check to only update the database if the contents of
the cell actually changed. This fix finishes that work. This
functionality was already in place for numeric cells.

Ed

Index: src/frm/frmEditGrid.cpp
================================================== =================
--- src/frm/frmEditGrid.cpp (revision 4990)
+++ src/frm/frmEditGrid.cpp (working copy)
@@ -131,7 +131,7 @@
toolBar->Realize();
toolBar->EnableTool(MNU_SAVE, false);
toolBar->EnableTool(MNU_UNDO, false);
- toolBar->EnableTool(MNU_COPY, false);
+ toolBar->EnableTool(MNU_COPY, true);
toolBar->EnableTool(MNU_DELETE, false);

wxAcceleratorEntry entries[5];
@@ -663,7 +663,6 @@
}
}
toolBar->EnableTool(MNU_DELETE, enable);
- toolBar->EnableTool(MNU_COPY, enable);
}
event.Skip();
}
@@ -991,6 +990,7 @@
protected:
int textlen;
bool isMultiLine;
+ wxString m_startValue;
};


@@ -1015,6 +1015,7 @@

void sqlGridTextEditor::BeginEdit(int row, int col, wxGrid *grid)
{
+ m_startValue = grid->GetTable()->GetValue(row, col);
wxGridCellTextEditor::BeginEdit(row, col, grid);
((ctlSQLGrid*)grid)->ResizeEditor(row, col);
}
@@ -1024,7 +1025,9 @@
{
bool changed = false;
wxString value = Text()->GetValue();
- changed = true;
+
+ if (value != m_startValue)
+ changed = true;

if (changed)
grid->GetTable()->SetValue(row, col, value);


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:28 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com