antoine-source/appleworksgs/PL/Src/PMENUS.S

1 line
14 KiB
ArmAsm
Raw Normal View History

2023-03-04 02:45:20 +00:00
load 'macros.dump' include 'driver.equ' include 'pl.equ' ;----------------------------------------------- ; ; Imported addresses ; ;----------------------------------------------- IMPORT D_CheckMenuFID IMPORT D_CurColor IMPORT D_CurMenuFont IMPORT D_DisableMItems IMPORT D_EnableMItems IMPORT P_BuildUndo IMPORT P_CurrentWin IMPORT P_DPTempl IMPORT P_DblPage IMPORT P_DefColor IMPORT P_DefFont IMPORT P_DefJust IMPORT P_DefSize IMPORT P_DefSpacing IMPORT P_DefStyle IMPORT P_DoSpacingDlog IMPORT P_ForceUpdate IMPORT P_HGuides IMPORT P_HPalette IMPORT P_HRulers IMPORT P_IsObjSel IMPORT P_LGuides IMPORT P_LockGuides IMPORT P_MagGuides IMPORT P_NPage IMPORT P_NTemplate IMPORT P_NotActive IMPORT P_Page IMPORT P_PageCount IMPORT P_PageMode IMPORT P_SGuides IMPORT P_SPTempl IMPORT P_SPalette IMPORT P_SRulers IMPORT P_SetObjAttr IMPORT P_ULGuides IMPORT P_UTemplate IMPORT P_UseTemplate IMPORT P_VPage IMPORT P_VisGuides IMPORT P_VisPalette IMPORT P_VisRuler IMPORT T_ChangeFont IMPORT T_ChangeRuls IMPORT T_DotParag IMPORT T_Editing IMPORT T_FontFlags IMPORT T_GetRulBits IMPORT T_NewAddStyle IMPORT T_NewColor IMPORT T_NewFont IMPORT T_NewSize IMPORT T_NewSubStyle IMPORT T_RangeFont IMPORT T_TextSelect IMPORT D_TextSelectOff IMPORT D_TextSelectOn ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY P_ChangeJust ENTRY P_ChangeSpace ENTRY P_GetMJust ENTRY P_GetMSpacing ENTRY P_SetFormat ;--------------------------------------------------------------------------- ; ; P_FixSpecMenu() ; ; Do miscellaneous menu checking / hilighting / Q_Text changing ; P_FixSpecMenu PROC EXPORT ;Using P_AttrData ;Using P_Data begin ; Fit in window / Normal view lda P_PageMode bne GoFull pushlong #P_VPage bra DoTempl GoFull pushlong #P_NPage DoTempl tool _SetMItem,in=(:l,#P_ViewPageItem:w) ; Show / hide guides DoVisG lda P_VisGuides bne MakeVisG call D_DisableMItems,in=(#P_LockGuideBit:w,#P_MenuOptions:w) call D_DisableMItems,in=(#P_MagGuideBit:w,#P_MenuOptions:w) pushlong #P_SGuides bra Lock MakeVisG call D_EnableMItems,in=(#P_LockGuideBit:w,#P_MenuOptions:w) call D_EnableMItems,in=(#P_MagGuideBit:w,#P_MenuOptions:w) pushlong #P_HGuides ; Lock / D_UnLock guides Lock tool _SetMItem,in=(:l,#P_HideGuideItem:w) lda P_LockGuides bne Lockit pushlong #P_LGuides bra DoVisR Lockit pushlong #P_ULGuides ; Show / Hide ruler DoVisR tool _SetMItem,in=(:l,#P_LockGuideItem:w) lda P_VisRuler bne MakeVisR pushlong #P_SRulers bra DoVisP MakeVisR pushlong #P_HRulers ; Show / hide palette DoVisP tool _SetMItem,in=(:l,#P_HideRulerItem:w) lda P_VisPalette bne MakeVisP pushlong #P_SPalette bra CkMag MakeVisP pushlong #P_HPalette CkMag tool _SetMItem,in=(:l,#P_HidePaletteItem:w) ; Check / Uncheck magnetic guides lda P_MagGuides bne MakeMag pushword #0 bra GotMag MakeMag pushword #'' GotMag tool _SetMItemMark,in=(:w,#P_MagGuideItem:w) ; Enable / disable Insert Page(s) cmpw P_PageCount,#P_MaxPages blt EnableInsert call D_DisableMItems,in=(#P_InsertBit:w,#P_MenuEdit:w) bra DidInsert EnableInsert call D_EnableMItems,in=(#P_InsertBit:w,#P_MenuEdit:w) ; (Don't) Use Master Page DidInsert lda P_DblPage bne GoSingle pushlong #P_DPTempl bra DoUse GoSingle pushlong #P_SPTempl DoUse tool _SetMItem,in=(:l,#P_DblPageItem:w) lda P_UseTemplate bne DontUse pushlong #P_UTemplate bra exit DontUse pushlong #P_NTemplate exit tool _SetMItem,in=(:l,#P_UseTempItem:w) cmpw P_Page,#2 bge DoEnable call D_DisableMItems,in=(#P_UseTempBit:w,#P_MenuOptions:w) bra DoCalc DoEnable call D_EnableMItems,in=(#P_UseTempBit:w,#P_MenuOptions:w) DoCalc tool _CalcMenuSize,in=(#0:w,#0:w,#4:w) return ENDP ;--------------------------------------------------------------------------- ; ; P_FixMenus () ; P_FixMenus PROC EXPORT ;Using P_Data ;Using P_AttrData ;Using T_Data LOCAL MenuFontID:l BEGIN