From 24221760e65a5a4c677831da2937812216fff599 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Tue, 21 Jul 2020 01:04:17 -0400 Subject: [PATCH] now working. --- morse16.rez | 53 ++++++++++++++++++++++++++++++++++++++++++----------- morse16.s | 25 +++++++++++++++++++------ 2 files changed, 61 insertions(+), 17 deletions(-) diff --git a/morse16.rez b/morse16.rez index 9b07b81..b5e2356 100644 --- a/morse16.rez +++ b/morse16.rez @@ -6,8 +6,9 @@ #define MENU_HEIGHT 12 #define BUTTON_HEIGHT 13 #define BUTTON_WIDTH 90 -#define kPlayID 1 -#define kStopID 2 +#define kTextEdit 1 +#define kPlayID 2 +#define kStopID 3 resource rWindParam1 (0x1000) { 0x8020, @@ -46,14 +47,14 @@ resource rControlList (0x1000) { }; resource rControlTemplate (0x1) { - 0x2, + kTextEdit, {4, 4, WIN_HEIGHT - 21, WIN_WIDTH - 4}, editTextControl { { /* optional Fields */ 0x0, 0x7400, 0x3, - 0x23A80000, + fSingleStyle+fTabSwitch+fSmartCutPaste+fDrawBounds+fColorHilight+fDrawInactiveSelection, {-1, -1, -1, -1}, 0x0, 0, @@ -76,13 +77,13 @@ resource rControlTemplate (0x1) { resource rControlTemplate (0x2) { - 0x4, + kPlayID, {WIN_HEIGHT - 4 - BUTTON_HEIGHT, 4, WIN_HEIGHT - 4, 4 + BUTTON_WIDTH}, SimpleButtonControl { { /* optional Fields */ - 0x3, + SquareShadowButton, 0x3002, - kPlayID, + 0, 0x1000F, 0x0, { @@ -96,13 +97,13 @@ resource rControlTemplate (0x2) { }; resource rControlTemplate (0x3) { - 0x5, + kStopID, {WIN_HEIGHT - 4 - BUTTON_HEIGHT, WIN_WIDTH - 4 - BUTTON_WIDTH, WIN_HEIGHT - 4, WIN_WIDTH - 4}, SimpleButtonControl { { /* optional Fields */ - 0x2, + SquareButton+CtlInactive, 0x3002, - kStopID, + 0, 0x10010, 0x0, { @@ -159,6 +160,14 @@ resource rPString (0x101, locked, fixed, nocrossbank, nospecialmemory) { "Quit" }; +resource rPString (0x102, locked, fixed, nocrossbank, nospecialmemory) { + "Select All" +}; + +resource rPString (0x103, locked, fixed, nocrossbank, nospecialmemory) { + "Preferences..." +}; + /* resource rPString (0x102, locked, fixed, nocrossbank, nospecialmemory) { "New" @@ -209,6 +218,7 @@ resource rMenu (0x1, locked, fixed, nocrossbank, nospecialmemory) { 0x1, { 0x100, + 0x103, } }; @@ -232,6 +242,7 @@ resource rMenu (0x3, locked, fixed, nocrossbank, nospecialmemory) { 0xFC, 0xFD, 0xFE, + 0x102 } }; @@ -294,7 +305,7 @@ resource rMenuItem (0x100, nocrossbank, nospecialmemory) { "", "", 0x0, - 0x8040, + 0x8000, 0x100 }; @@ -307,6 +318,26 @@ resource rMenuItem (0x101, nocrossbank, nospecialmemory) { 0x101 }; +resource rMenuItem (0x102, nocrossbank, nospecialmemory) { + 0x102, + "A", + "a", + 0x0, + 0x8000, + 0x102 +}; + + +resource rMenuItem (0x103, nocrossbank, nospecialmemory) { + 0x103, + "", + "", + 0x0, + 0x8000+rMIDisabled+rMIDivider, + 0x103 +}; + + /* resource rMenuItem (0x102, nocrossbank, nospecialmemory) { 0x102, diff --git a/morse16.s b/morse16.s index d7b5cf6..da7d11e 100644 --- a/morse16.s +++ b/morse16.s @@ -13,8 +13,9 @@ * lst on kWindowID equ $1000 -kPlayID equ 1 -kStopID equ 2 +kTextEdit equ 1 +kPlayID equ 2 +kStopID equ 3 kAboutAlert equ 1 tbx on @@ -105,9 +106,9 @@ mainloop _InitCursor stz quit - lda #$0001ffff + lda #$001fffff sta event+owmTaskMask - lda #^$0001ffff + lda #^$001fffff sta event+owmTaskMask+2 :loop @@ -120,6 +121,7 @@ mainloop bcs :loop asl + tax jsr (:table,x) lda quit beq :loop @@ -200,10 +202,20 @@ menu dw :rts ; 253 paste dw :rts ; 254 clear dw :rts ; 255 close - dw bye ; 256 - quit - dw about + dw about ; 256 about + dw bye ; 257 quit + dw :select ; 258 - select all + dw :rts ; 259 - preferences :table_size = {*-:table}/2 + +:select + psl #0 + psl #255 + psl #0 + _TESetSelection + rts + about pha psw #awResource @@ -224,6 +236,7 @@ control :table dw :rts ; 0 - none + dw :rts ; text edit. dw play dw stop :table_size = {*-:table}/2