Le 14/09/2010 13:09, Steffen Kuhn a écrit :
> Hi Guillaume,
> 
> checking for changed values is what I tried to, but my place was 
> sqlGridEditor::EndEdit because this is already checked there.

Oh, yeah, I didn't see that. You're right.

> But checking here, may be also in OnEditorHidden can be dangerous I think, 
> because of
> there might be previous changes that might be lost by just disableing 'Save' 
> if one cell has not been changed.
> This may also happen by doing CancelChange with 'ESC'.
> I think there will be no other way as comparing the whole row.
> 
> I would prefer you fixing this, it's to hot for me right now.
> 

This patch should do it, can you try and test it, please?

Thanks.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
diff --git a/pgadmin/frm/frmEditGrid.cpp b/pgadmin/frm/frmEditGrid.cpp
index 5973434..e530bf0 100644
--- a/pgadmin/frm/frmEditGrid.cpp
+++ b/pgadmin/frm/frmEditGrid.cpp
@@ -881,6 +881,10 @@ void frmEditGrid::OnKey(wxKeyEvent &event)
 
             break;
 
+        case WXK_ESCAPE:
+            CancelChange();
+            break;
+
         default:
             if (sqlGrid->IsEditable() && keycode >= WXK_SPACE && keycode < WXK_START)
             {
@@ -904,6 +908,9 @@ void frmEditGrid::OnClose(wxCommandEvent& event)
 
 void frmEditGrid::OnCloseWindow(wxCloseEvent& event)
 {
+    wxGridEvent evt;
+    OnCellChange(evt);
+
     if (toolBar->GetToolEnabled(MNU_SAVE))
     {
         int flag=wxYES_NO | wxICON_QUESTION;
-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to