Added initial save file funtionality

This commit is contained in:
Armando Rivera 2023-01-13 21:19:03 -05:00
parent 89b3b58b40
commit 8d51ab873e

View File

@ -134,6 +134,26 @@ SUB SetTabLabelText(fname$, index AS INTEGER)
tabItem.cchTextMax = BCXSTRSIZE tabItem.cchTextMax = BCXSTRSIZE
TabCtrl_SetItem(ghMainTab, index, &tabItem) TabCtrl_SetItem(ghMainTab, index, &tabItem)
END SUB
SUB RaSaveFile(hEDT as HWND)
DIM eSIZE, fNAME$, tabName$
eSIZE = GetWindowTextLength(hEDT)
DIM eTEXT$*eSIZE+1
tabName$ = GetTabLabelText(TabCtrl_GetCurSel(ghMainTab))
' msgbox(tabName)
fNAME$ = GETFILENAME$("Save","BCX Files|*.BAS;*.INC;*.bi;*.bci",1,ghMainFrm,0,0,tabName$,0)
IF *fNAME$ THEN
eTEXT$ = BCX_GET_TEXT$(hEDT)
OPEN fNAME$ FOR OUTPUT AS FP1
PUT$ FP1, eTEXT$, LEN(eTEXT$)
CLOSE FP1
END IF
END SUB END SUB
'================================================================ '================================================================
@ -157,7 +177,10 @@ BEGIN EVENTS
IF *fname$ THEN IF *fname$ THEN
SetTabLabelText(fname$, TabCtrl_GetCurSel(ghMainTab)) SetTabLabelText(fname$, TabCtrl_GetCurSel(ghMainTab))
END IF END IF
CASE mnuSave
RaSaveFile(ghEdit[TabCtrl_GetCurSel(ghMainTab)])
CASE mnuNew CASE mnuNew
RaNewEdit() RaNewEdit()