# # old_revision [b6f4057a2844a61879d5fca7e774fa9e5d3db5b6] # # patch "itemwindow.tcl" # from [c9b3c2b0dc629c0aa26cf12a9c060d6193897a42] # to [fd6d4fc49e1076f2c15de3d525cd1281e07e64ee] # # patch "support.tcl" # from [d85bc5191ac2f9f25dcbfedd206ce1c3da55cd46] # to [973dd34badd20c7b7fe275d0eec6c012db8c177c] # ============================================================ --- itemwindow.tcl c9b3c2b0dc629c0aa26cf12a9c060d6193897a42 +++ itemwindow.tcl fd6d4fc49e1076f2c15de3d525cd1281e07e64ee @@ -77,6 +77,8 @@ $canvas bind link.$self [list $self follow_link] $canvas bind click.$self {ical_edit_item} + $canvas bind $self [list $self prop_menu %X %Y %x %y] + global item_map set item_map([winfo toplevel $canvas],$item,$date) $self @@ -276,6 +278,58 @@ return $slot(date) } +method ItemWindow prop_menu {X Y x y} { + global iw_cal + + $self click $x $y + set m .${self}_menu + destroy $m $m.hl $m.c + menu $m -tearoff no + $m add command -label "Properties..." -command {ical_edit_item} + menu $m.c -tearoff no + set iw_cal [$slot(item) calendar] + foreach cal [lsort [ical_filenames]] { + $m.c add radiobutton -label $cal -variable iw_cal \ + -value $cal -command {itemwindow_calendar} + } + $m add cascade -label "Calendar" -menu $m.c + $m add separator + $m add checkbutton -label "Todo" -command {ical_toggle_todo} \ + -variable dv_state(state:todo) + $m add separator + menu $m.hl -tearoff no + $m.hl add radiobutton -label "Always" -command "ical_hilite always" \ + -variable dv_state(state:hilite) -value "always" + $m.hl add radiobutton -label "Never" -command "ical_hilite never" \ + -variable dv_state(state:hilite) -value "never" + $m.hl add radiobutton -label "Future" -command "ical_hilite expire" \ + -variable dv_state(state_hilite) -value "expire" + $m.hl add radiobutton -label "Holiday" -command "ical_hilite holiday" \ + -variable dv_state(state_hilite) -value "holiday" + $m add cascade -label "Highlight" -menu $m.hl + menu $m.r -tearoff no + $m.r add command -label "Don't Repeat" -command {ical_norepeat} + $m.r add separator + $m.r add command -label "Daily" -command {ical_daily} + $m.r add command -label "Weekly" -command {ical_weekly} + $m.r add command -label "Monthly" -command {ical_monthly} + $m.r add command -label "Annually" -command {ical_annual} + $m.r add separator + $m.r add command -label "Edit Weekly..." -command {ical_edit_weekly} + $m.r add command -label "Edit Monthly..." -command {ical_edit_monthly} + $m.r add command -label "Set Range..." -command {ical_set_range} + $m.r add separator + $m.r add command -label "Last Occurrence" -command {ical_last_date} + $m.r add command -label "Make Unique" -command {ical_makeunique} + $m add cascade -label "Repeat" -menu $m.r + $m add separator + $m add command -label "Cut" -command {ical_cut_or_hide} + $m add command -label "Copy" -command {ical_copy} + run-hook item-popup $self $m + tk_popup $m $X $Y + return $m +} + ############################################################################## # ApptItemWindow # @@ -342,10 +396,6 @@ $canvas bind $self [list $self move_start %y] $canvas bind $self [list $self move_continue %y] $canvas bind $self [list $self move_finish %y] - - $canvas bind $self [list $self size_start %y] - $canvas bind $self [list $self size_continue %y] - $canvas bind $self [list $self size_finish %y] } method ApptItemWindow save {} { @@ -690,3 +740,10 @@ bind $tag $seq $cmd } } + +proc itemwindow_calendar {} { + global last_sel iw_cal + if {[string compare [[$last_sel item] calendar] $iw_cal]} { + cal add [$last_sel item] $iw_cal + } +} ============================================================ --- support.tcl d85bc5191ac2f9f25dcbfedd206ce1c3da55cd46 +++ support.tcl 973dd34badd20c7b7fe275d0eec6c012db8c177c @@ -51,6 +51,7 @@ create-hook alarm-fire create-hook item-select create-hook item-unselect + create-hook item-popup create-hook dayview-startup create-hook dayview-close