[PD-cvs] pd/src desire.tk,1.1.2.600.2.214,1.1.2.600.2.215

Mathieu Bouchard matju at users.sourceforge.net
Wed Jul 11 04:44:18 CEST 2007


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31280

Modified Files:
      Tag: desiredata
	desire.tk 
Log Message:
fixed problem closing ClipboardDialog and HistoryDialog; renamed HistoryDialog to CommandHistoryDialog.


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.214
retrieving revision 1.1.2.600.2.215
diff -C2 -d -r1.1.2.600.2.214 -r1.1.2.600.2.215
*** desire.tk	11 Jul 2007 00:36:39 -0000	1.1.2.600.2.214
--- desire.tk	11 Jul 2007 02:44:14 -0000	1.1.2.600.2.215
***************
*** 330,338 ****
  set subpatcherize(edit2) ""
  #-----------------------------------------------------------------------------------#
- # adapted from matju's MetaRuby (UndoQueue.rb)
  
! class_new History {Observable Thing}
  
! def History init {} {
  	super
  	set @undo_stack {}
--- 330,338 ----
  set subpatcherize(edit2) ""
  #-----------------------------------------------------------------------------------#
  
! #-----------------------------------------------------------------------------------#
! class_new CommandHistory {Observable Thing}
  
! def CommandHistory init {} {
  	super
  	set @undo_stack {}
***************
*** 340,354 ****
  }
  
! def History can_undo? {} {return [expr [llength @undo_stack] > 0]}
! def History can_redo? {} {return [expr [llength @redo_stack] > 0]}
! def History next_undo_name {} {return stuff}
! def History next_redo_name {} {return stuff}
! def History undo_stack {} {return $@undo_stack}
! def History redo_stack {} {return $@redo_stack}
  
  # overload this if you want to control how many levels
  # of undo may be kept.
  # keep in mind that undo information is kept hierarchically.
! def History add {message} {
  	lappend @undo_stack [list do $message [lrange [info level -3] 1 end]]
  	set @redo_stack {}
--- 340,354 ----
  }
  
! def CommandHistory can_undo? {} {return [expr [llength @undo_stack] > 0]}
! def CommandHistory can_redo? {} {return [expr [llength @redo_stack] > 0]}
! def CommandHistory next_undo_name {} {return stuff}
! def CommandHistory next_redo_name {} {return stuff}
! def CommandHistory undo_stack {} {return $@undo_stack}
! def CommandHistory redo_stack {} {return $@redo_stack}
  
  # overload this if you want to control how many levels
  # of undo may be kept.
  # keep in mind that undo information is kept hierarchically.
! def CommandHistory add {message} {
  	lappend @undo_stack [list do $message [lrange [info level -3] 1 end]]
  	set @redo_stack {}
***************
*** 356,360 ****
  }
  
! def History can't {} {
  	lappend @undo_stack [list can't {} [lrange [info level -3] 1 end]]
  	set @redo_stack {}
--- 356,360 ----
  }
  
! def CommandHistory can't {} {
  	lappend @undo_stack [list can't {} [lrange [info level -3] 1 end]]
  	set @redo_stack {}
***************
*** 363,367 ****
  
  # runs the restore procedure for the last item in the root undo queue.
! def History undo {} {
  	global errorInfo
  	if {![$self can_perform? [lindex $@undo_stack end]]} {error "Can't undo this!"}
--- 363,367 ----
  
  # runs the restore procedure for the last item in the root undo queue.
! def CommandHistory undo {} {
  	global errorInfo
  	if {![$self can_perform? [lindex $@undo_stack end]]} {error "Can't undo this!"}
***************
*** 377,381 ****
  }
  
! def History redo {} {
  	global errorInfo
  	if {![$self can_perform? [lindex $@undo_stack end]]} {error "Can't redo this!"}
--- 377,381 ----
  }
  
! def CommandHistory redo {} {
  	global errorInfo
  	if {![$self can_perform? [lindex $@undo_stack end]]} {error "Can't redo this!"}
***************
*** 389,393 ****
  }
  
! def History can_perform? {action} {
  	switch -- [lindex $action 0] {
  	  do      {return 1}
--- 389,393 ----
  }
  
! def CommandHistory can_perform? {action} {
  	switch -- [lindex $action 0] {
  	  do      {return 1}
***************
*** 402,406 ****
  }
  
! def History perform {action} {
  	switch -- [lindex $action 0] {
  	  do      {eval [lindex $action 1]}
--- 402,406 ----
  }
  
! def CommandHistory perform {action} {
  	switch -- [lindex $action 0] {
  	  do      {eval [lindex $action 1]}
***************
*** 410,414 ****
  }
  
! def History atomically {what code} {
  	global errorInfo
  	set ubackup @undo_stack; set @undo_stack {}
--- 410,414 ----
  }
  
! def CommandHistory atomically {what code} {
  	global errorInfo
  	set ubackup @undo_stack; set @undo_stack {}
***************
*** 424,428 ****
  }
  
! set history [History new]
  
  #-----------------------------------------------------------------------------------#
--- 424,428 ----
  }
  
! set command_history [CommandHistory new]
  
  #-----------------------------------------------------------------------------------#
***************
*** 472,478 ****
--- 472,488 ----
  	# "text" dialogs below. Also we have to get rid of tab's changing the focus.
  	bind all <Key-Tab> ""
+ 	#bind all <Key-Shift-Tab> ""
  	bind all <<PrevWindow>> ""
  	bind Text <Control-t> {}
  	bind Text <Control-s> {}
+ 	bind all <KeyPress>      {event_record KeyPress      %W %X %Y %K}
+ 	bind all <KeyRelease>    {event_record KeyRelease    %W %X %Y %K}
+ 	bind all <ButtonPress>   {event_record ButtonPress   %W %X %Y %b}
+ 	bind all <ButtonRelease> {event_record ButtonRelease %W %X %Y %B}
+ }
+ 
+ set ::event_history [list]
+ proc event_record {args} {
+ 	lappend ::event_history $args
  }
  
***************
*** 1049,1053 ****
  	quit}
      $self populate_menu help {
! 	about documentation class_browser client_class_tree clipboard_view history_view do_what_i_mean {}
  	test_audio_and_midi load_meter latency_meter}
  }
--- 1059,1063 ----
  	quit}
      $self populate_menu help {
! 	about documentation class_browser client_class_tree clipboard_view command_history_view event_history_view do_what_i_mean {}
  	test_audio_and_midi load_meter latency_meter}
  }
***************
*** 1433,1438 ****
  def Client audio_on  {} {netsend [list pd dsp 1]}
  def Client audio_off {} {netsend [list pd dsp 0]}
! def Client clipboard_view {} {global clipboard; ClipboardDialog new $clipboard}
! def Client   history_view {} {global history;   HistoryDialog   new $history}
  def Client do_what_i_mean {} {wonder}
  
--- 1443,1449 ----
  def Client audio_on  {} {netsend [list pd dsp 1]}
  def Client audio_off {} {netsend [list pd dsp 0]}
! def Client       clipboard_view {} {ClipboardDialog new $::clipboard}
! def Client command_history_view {} {     ListDialog new $::command_history}
! def Client   event_history_view {} {     ListDialog new $::event_history}
  def Client do_what_i_mean {} {wonder}
  
***************
*** 1513,1517 ****
  
  def Canvas init {mess} {
!     global pd_opendir pd_tearoff cmdline history manager window_list
      lappend window_list $self
      set @mapped 0
--- 1524,1528 ----
  
  def Canvas init {mess} {
!     global pd_opendir pd_tearoff cmdline manager window_list
      lappend window_list $self
      set @mapped 0
***************
*** 1537,1541 ****
      set @wires {}
  #    if {$@mapped} {$self init_window} ;#!@#$ @mapped can't possibly be 1 at this point
!     set @history $history
      $self subscribe $manager
      $self changed
--- 1548,1552 ----
      set @wires {}
  #    if {$@mapped} {$self init_window} ;#!@#$ @mapped can't possibly be 1 at this point
!     set @history $::command_history
      $self subscribe $manager
      $self changed
***************
*** 3198,3202 ****
  	pack $f.entry -side left -fill x -expand yes
  	bind $f.entry <Control-Tab> "$self traversal %K %W forward"
- 
  }
  
--- 3209,3212 ----
***************
*** 7837,7853 ****
  
  def ClipboardDialog delete {} {
- 	super
  	$@clipboard unsubscribe $self
  }
  
  #----------------------------------------------------------------
! class_new HistoryDialog {Dialog}
  
! def HistoryDialog init {history} {
  	super close
  	set @history $history
! 	wm title .$self "History"
! 	pack [listbox .$self.list -yscrollcommand ".$self.scroll set" -width 72
! 	     ] -side left -fill both -expand yes
  	pack [scrollbar .$self.scroll -command ".$self.list yview"] -side right -fill y
  	$@history subscribe $self
--- 7847,7862 ----
  
  def ClipboardDialog delete {} {
  	$@clipboard unsubscribe $self
+ 	super
  }
  
  #----------------------------------------------------------------
! class_new ListDialog {Dialog}
  
! def ListDialog init {history} {
  	super close
  	set @history $history
! 	wm title .$self "CommandHistory"
! 	pack [listbox .$self.list -yscrollcommand ".$self.scroll set" -width 72] -side left -fill both -expand yes
  	pack [scrollbar .$self.scroll -command ".$self.list yview"] -side right -fill y
  	$@history subscribe $self
***************
*** 7855,7859 ****
  }
  
! def HistoryDialog notice {args} {
  	.$self.list delete 0 end
  	set hist [concat [$@history undo_stack] [list "You Are Here"] [lreverse [$@history redo_stack]]]
--- 7864,7868 ----
  }
  
! def ListDialog notice {args} {
  	.$self.list delete 0 end
  	set hist [concat [$@history undo_stack] [list "You Are Here"] [lreverse [$@history redo_stack]]]
***************
*** 7866,7872 ****
  }
  
! def HistoryDialog delete {} {
! 	super
  	$@history unsubscribe $self
  }
  
--- 7875,7881 ----
  }
  
! def ListDialog delete {} {
  	$@history unsubscribe $self
+ 	super
  }
  





More information about the Pd-cvs mailing list