Skip to content

Commit

Permalink
DeskTop: Factor out file icon selection method
Browse files Browse the repository at this point in the history
Will be used for issue #16
  • Loading branch information
inexorabletash committed Jan 3, 2020
1 parent c0a34ca commit 3a2f43f
Showing 1 changed file with 33 additions and 19 deletions.
52 changes: 33 additions & 19 deletions desktop/desktop_main.s
Expand Up @@ -3774,27 +3774,10 @@ L5CFB: bit BUTN0
beq :+ ; if so, retain selection
replace:
jsr clear_selection
: ldx selected_icon_count
:
lda icon_num
sta selected_icon_list,x
inc selected_icon_count

copy active_window_id, selected_window_index

copy active_window_id, getwinport_params2::window_id
jsr get_set_port2

copy icon_num, icon_param
jsr icon_screen_to_window
jsr offset_grafport2_and_set
ITK_RELAY_CALL IconTK::HighlightIcon, icon_param

copy active_window_id, getwinport_params2::window_id
jsr get_set_port2
jsr select_file_icon

lda icon_num
jsr icon_window_to_screen
jsr reset_grafport3
bit double_click_flag
bmi start_icon_drag
jmp handle_double_click
Expand Down Expand Up @@ -3972,6 +3955,37 @@ L5E77: .byte 0
swap_in_desktop_icon_table := handle_file_icon_click_impl::swap_in_desktop_icon_table
process_drop := handle_file_icon_click_impl::process_drop

;;; ============================================================
;;; Add specified icon (in active window!) to selection list,
;;; and redraw.
;;; Input: A = icon number

.proc select_file_icon
sta icon_num
ldx selected_icon_count
sta selected_icon_list,x
inc selected_icon_count
copy active_window_id, selected_window_index
copy active_window_id, getwinport_params2::window_id

jsr get_set_port2

copy icon_num, icon_param
jsr icon_screen_to_window

jsr offset_grafport2_and_set
ITK_RELAY_CALL IconTK::HighlightIcon, icon_param
copy active_window_id, getwinport_params2::window_id
jsr get_set_port2

lda icon_num
jsr icon_window_to_screen
jmp reset_grafport3

icon_num:
.byte 0
.endproc

;;; ============================================================

.proc select_and_refresh_window
Expand Down

0 comments on commit 3a2f43f

Please sign in to comment.