Skip to content

Commit 94f2868

Browse files
committed
fixed saving/cancelling of changes from edit window
1 parent 2fc56c9 commit 94f2868

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

xojo-project-files/WindowEdit.xojo_window

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ Begin DesktopWindow WindowEdit
2424
Type = 3
2525
Visible = True
2626
Width = 1394
27-
Begin DesktopButton ButtonClose
27+
Begin DesktopButton ButtonSave
2828
AllowAutoDeactivate= True
2929
Bold = False
3030
Cancel = False
31-
Caption = "Close"
31+
Caption = "Save"
3232
Default = False
3333
Enabled = True
3434
FontName = "System"
@@ -618,7 +618,7 @@ End
618618
#tag WindowCode
619619
#tag Event
620620
Function CancelClosing(appQuitting As Boolean) As Boolean
621-
if not appQuitting then
621+
if ( not appQuitting ) and self.editConfirmed then
622622

623623
self.data.m_Name = self.TextField_m_Name.Text
624624

@@ -716,6 +716,16 @@ End
716716
Function handleKey(key as String) As Boolean
717717
if key = chr( 13 ) then
718718

719+
self.editConfirmed = true
720+
721+
self.Close()
722+
723+
return true
724+
725+
elseif key = chr( 27 ) then
726+
727+
self.editConfirmed = false
728+
719729
self.Close()
720730

721731
return true
@@ -732,6 +742,10 @@ End
732742
Private data As AxisSetting
733743
#tag EndProperty
734744

745+
#tag Property, Flags = &h21
746+
Private editConfirmed As Boolean
747+
#tag EndProperty
748+
735749
#tag Property, Flags = &h21
736750
Private opening As Boolean
737751
#tag EndProperty
@@ -743,9 +757,11 @@ End
743757

744758
#tag EndWindowCode
745759

746-
#tag Events ButtonClose
760+
#tag Events ButtonSave
747761
#tag Event
748762
Sub Pressed()
763+
self.editConfirmed = true
764+
749765
self.Close()
750766

751767

xojo-project-files/WindowMain.xojo_window

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,12 +681,18 @@ End
681681
#tag EndEvent
682682
#tag Event
683683
Function DragReorderRows(newPosition as Integer, parentRow as Integer) As Boolean
684+
#pragma unused newPosition
685+
686+
#pragma unused parentRow
687+
684688
self.Changed = true
685689

686690
End Function
687691
#tag EndEvent
688692
#tag Event
689693
Function HeaderPressed(column as Integer) As Boolean
694+
#pragma unused column
695+
690696
self.Changed = true
691697

692698

0 commit comments

Comments
 (0)