diff --git a/backup/main.lfm b/backup/main.lfm index 087ce23..35dc168 100644 --- a/backup/main.lfm +++ b/backup/main.lfm @@ -1,11 +1,12 @@ object GUIForm: TGUIForm - Left = 275 - Height = 683 - Top = 109 + Left = 290 + Height = 650 + Top = 130 Width = 1078 + AllowDropFiles = True AlphaBlendValue = 128 Caption = 'microM8 GUI' - ClientHeight = 663 + ClientHeight = 630 ClientWidth = 1078 Constraints.MinWidth = 1078 DoubleBuffered = False @@ -15,6 +16,7 @@ object GUIForm: TGUIForm OnCloseQuery = FormCloseQuery OnCreate = FormCreate OnDeactivate = FormDeactivate + OnDropFiles = FormDropFiles OnHide = FormHide OnKeyDown = FormKeyDown OnKeyPress = FormKeyPress @@ -30,7 +32,7 @@ object GUIForm: TGUIForm object StatusBar1: TStatusBar Left = 0 Height = 23 - Top = 640 + Top = 607 Width = 1078 Panels = <> end @@ -327,38 +329,39 @@ object GUIForm: TGUIForm end object pnlContainer: TPanel Left = 0 - Height = 604 + Height = 571 Top = 36 Width = 1078 Align = alClient BevelOuter = bvNone - ClientHeight = 604 + ClientHeight = 571 ClientWidth = 1078 ParentColor = False TabOrder = 2 object sidecarPanel: TPanel Left = 908 - Height = 567 + Height = 534 Top = 0 Width = 170 Align = alRight BevelOuter = bvNone Caption = 'sidecarPanel' - ClientHeight = 567 + ClientHeight = 534 ClientWidth = 170 Color = clBlack ParentColor = False TabOrder = 0 object Image1: TImage Left = 0 - Height = 567 + Height = 534 Top = 0 Width = 170 Align = alClient OnClick = Image1Click OnDblClick = Image1DblClick - OnDragDrop = Image1DragDrop OnMouseDown = Image1MouseDown + OnMouseLeave = Image1MouseLeave + OnMouseMove = Image1MouseMove OnMouseUp = Image1MouseUp Picture.Data = { 1754506F727461626C654E6574776F726B477261706869636B7A020089504E47 @@ -5444,12 +5447,12 @@ object GUIForm: TGUIForm end object embedPanel: TPanel Left = 0 - Height = 567 + Height = 534 Top = 0 Width = 908 Align = alClient BevelOuter = bvNone - ClientHeight = 567 + ClientHeight = 534 ClientWidth = 908 Color = clBlack Font.Color = clWhite @@ -5461,7 +5464,7 @@ object GUIForm: TGUIForm OnMouseUp = FormMouseUp object backdrop: TImage Left = 0 - Height = 567 + Height = 534 Top = 0 Width = 908 Align = alClient @@ -5474,7 +5477,7 @@ object GUIForm: TGUIForm object pnlMemory: TPanel Left = 0 Height = 37 - Top = 567 + Top = 534 Width = 1078 Align = alBottom ClientHeight = 37 diff --git a/backup/main.pas b/backup/main.pas index 281435d..ba15880 100644 --- a/backup/main.pas +++ b/backup/main.pas @@ -345,6 +345,7 @@ type procedure FormCloseQuery(Sender: TObject; var CanClose: boolean); procedure FormCreate(Sender: TObject); procedure FormDeactivate(Sender: TObject); + procedure FormDropFiles(Sender: TObject; const FileNames: array of String); procedure FormHide(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormKeyPress(Sender: TObject; var Key: char); @@ -363,6 +364,9 @@ type procedure Image1DragDrop(Sender, Source: TObject; X, Y: Integer); procedure Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Image1MouseLeave(Sender: TObject); + procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer + ); procedure Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure InputClick(Sender: TObject); @@ -588,6 +592,7 @@ type VolDrag, WarpDrag: boolean; Caps: boolean; NeedsRestart, Quitting: boolean; + sbx, sby, sbButton: longint; public procedure AppActivate(Sender: TObject); procedure AppDeactivate(Sender: TObject); @@ -737,6 +742,19 @@ begin // nothing much end; +procedure TGUIForm.Image1MouseLeave(Sender: TObject); +begin + sbx := -1; + sby := -1; +end; + +procedure TGUIForm.Image1MouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + sbx := x; + sby := y; +end; + procedure TGUIForm.Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var @@ -1894,6 +1912,22 @@ begin //StatusBar1.SimpleText := StatusBar1.SimpleText + ' (in window)'; SendMouseState( x - longint(p.X), y - longint(p.Y) ); end; + + { Now see if we are over the sidecar } + p := sidecarPanel.ClientToScreen(q); + if (x >= longint(p.X)) and (x < longint(p.X)+longint(sidecarPanel.Width)) and + (y >= longint(p.Y)) and (y < longint(p.Y)+longint(sidecarPanel.Height)) then + begin + sbx := x - p.X; + sby := y - p.Y; + sbButton := sby div Round(sidecarPanel.Height/5); + end + else + begin + sbx := -1; + sby := -1; + sbButton := -1; + end; end; end; @@ -2835,6 +2869,37 @@ begin lastFocusLostTime:=Now(); end; +procedure TGUIForm.FormDropFiles(Sender: TObject; + const FileNames: array of String); +var + filename, ext: string; +begin + //StatusBar1.SimpleText := IntToStr(sbButton) + ':' + FileNames[0]; + filename := FileNames[0]; + ext := ExtractFileExt(filename); + case sbButton of + 0, 1: begin + case ext of + '.dsk', '.do', '.po', '.woz', '.nib': begin + // insert disk here + InsertDisk( 'local:'+filename, sbButton ); + ShowM8; + SendOSDMessage('Disk Insert to Drive '+IntToStr(sbButton+1)); + end; + end; + end; + 3: begin + case ext of + '.po', '.2mg', '.hdv': begin + // insert smartport here + InsertDisk( 'local:'+filename, 2 ); + ShowM8; + end; + end; + end; + end; +end; + procedure TGUIForm.FormHide(Sender: TObject); begin RepaintWindow; @@ -3174,13 +3239,13 @@ end; procedure TGUIForm.FSTimerTimer(Sender: TObject); begin isFS := (GetConfig( 'video/current.fullscreen' ) = '1'); - if not hidden then - begin - Caption := 'microM8 GUI'; - SimpleGet(baseUrl+'/api/control/system/heartbeat'); - end - else - Caption := 'microM8 GUI (hide)'; + //if not hidden then + //begin + // Caption := 'microM8 GUI'; + // SimpleGet(baseUrl+'/api/control/system/heartbeat'); + //end + //else + // Caption := 'microM8 GUI (hide)'; end; procedure TGUIForm.InputClick(Sender: TObject); diff --git a/backup/poc.lps b/backup/poc.lps index cb5291f..1c96fab 100644 --- a/backup/poc.lps +++ b/backup/poc.lps @@ -21,8 +21,8 @@ - - + + @@ -43,7 +43,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -61,129 +61,129 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/lib/x86_64-win64/main.lfm b/lib/x86_64-win64/main.lfm index 087ce23..35dc168 100644 --- a/lib/x86_64-win64/main.lfm +++ b/lib/x86_64-win64/main.lfm @@ -1,11 +1,12 @@ object GUIForm: TGUIForm - Left = 275 - Height = 683 - Top = 109 + Left = 290 + Height = 650 + Top = 130 Width = 1078 + AllowDropFiles = True AlphaBlendValue = 128 Caption = 'microM8 GUI' - ClientHeight = 663 + ClientHeight = 630 ClientWidth = 1078 Constraints.MinWidth = 1078 DoubleBuffered = False @@ -15,6 +16,7 @@ object GUIForm: TGUIForm OnCloseQuery = FormCloseQuery OnCreate = FormCreate OnDeactivate = FormDeactivate + OnDropFiles = FormDropFiles OnHide = FormHide OnKeyDown = FormKeyDown OnKeyPress = FormKeyPress @@ -30,7 +32,7 @@ object GUIForm: TGUIForm object StatusBar1: TStatusBar Left = 0 Height = 23 - Top = 640 + Top = 607 Width = 1078 Panels = <> end @@ -327,38 +329,39 @@ object GUIForm: TGUIForm end object pnlContainer: TPanel Left = 0 - Height = 604 + Height = 571 Top = 36 Width = 1078 Align = alClient BevelOuter = bvNone - ClientHeight = 604 + ClientHeight = 571 ClientWidth = 1078 ParentColor = False TabOrder = 2 object sidecarPanel: TPanel Left = 908 - Height = 567 + Height = 534 Top = 0 Width = 170 Align = alRight BevelOuter = bvNone Caption = 'sidecarPanel' - ClientHeight = 567 + ClientHeight = 534 ClientWidth = 170 Color = clBlack ParentColor = False TabOrder = 0 object Image1: TImage Left = 0 - Height = 567 + Height = 534 Top = 0 Width = 170 Align = alClient OnClick = Image1Click OnDblClick = Image1DblClick - OnDragDrop = Image1DragDrop OnMouseDown = Image1MouseDown + OnMouseLeave = Image1MouseLeave + OnMouseMove = Image1MouseMove OnMouseUp = Image1MouseUp Picture.Data = { 1754506F727461626C654E6574776F726B477261706869636B7A020089504E47 @@ -5444,12 +5447,12 @@ object GUIForm: TGUIForm end object embedPanel: TPanel Left = 0 - Height = 567 + Height = 534 Top = 0 Width = 908 Align = alClient BevelOuter = bvNone - ClientHeight = 567 + ClientHeight = 534 ClientWidth = 908 Color = clBlack Font.Color = clWhite @@ -5461,7 +5464,7 @@ object GUIForm: TGUIForm OnMouseUp = FormMouseUp object backdrop: TImage Left = 0 - Height = 567 + Height = 534 Top = 0 Width = 908 Align = alClient @@ -5474,7 +5477,7 @@ object GUIForm: TGUIForm object pnlMemory: TPanel Left = 0 Height = 37 - Top = 567 + Top = 534 Width = 1078 Align = alBottom ClientHeight = 37 diff --git a/lib/x86_64-win64/main.o b/lib/x86_64-win64/main.o index 7ef337c..d865cf2 100644 Binary files a/lib/x86_64-win64/main.o and b/lib/x86_64-win64/main.o differ diff --git a/lib/x86_64-win64/main.ppu b/lib/x86_64-win64/main.ppu index a5954ab..a31d5af 100644 Binary files a/lib/x86_64-win64/main.ppu and b/lib/x86_64-win64/main.ppu differ diff --git a/lib/x86_64-win64/poc.obj b/lib/x86_64-win64/poc.obj index 72a9af0..4f31f4c 100644 Binary files a/lib/x86_64-win64/poc.obj and b/lib/x86_64-win64/poc.obj differ diff --git a/main.lfm b/main.lfm index 087ce23..35dc168 100644 --- a/main.lfm +++ b/main.lfm @@ -1,11 +1,12 @@ object GUIForm: TGUIForm - Left = 275 - Height = 683 - Top = 109 + Left = 290 + Height = 650 + Top = 130 Width = 1078 + AllowDropFiles = True AlphaBlendValue = 128 Caption = 'microM8 GUI' - ClientHeight = 663 + ClientHeight = 630 ClientWidth = 1078 Constraints.MinWidth = 1078 DoubleBuffered = False @@ -15,6 +16,7 @@ object GUIForm: TGUIForm OnCloseQuery = FormCloseQuery OnCreate = FormCreate OnDeactivate = FormDeactivate + OnDropFiles = FormDropFiles OnHide = FormHide OnKeyDown = FormKeyDown OnKeyPress = FormKeyPress @@ -30,7 +32,7 @@ object GUIForm: TGUIForm object StatusBar1: TStatusBar Left = 0 Height = 23 - Top = 640 + Top = 607 Width = 1078 Panels = <> end @@ -327,38 +329,39 @@ object GUIForm: TGUIForm end object pnlContainer: TPanel Left = 0 - Height = 604 + Height = 571 Top = 36 Width = 1078 Align = alClient BevelOuter = bvNone - ClientHeight = 604 + ClientHeight = 571 ClientWidth = 1078 ParentColor = False TabOrder = 2 object sidecarPanel: TPanel Left = 908 - Height = 567 + Height = 534 Top = 0 Width = 170 Align = alRight BevelOuter = bvNone Caption = 'sidecarPanel' - ClientHeight = 567 + ClientHeight = 534 ClientWidth = 170 Color = clBlack ParentColor = False TabOrder = 0 object Image1: TImage Left = 0 - Height = 567 + Height = 534 Top = 0 Width = 170 Align = alClient OnClick = Image1Click OnDblClick = Image1DblClick - OnDragDrop = Image1DragDrop OnMouseDown = Image1MouseDown + OnMouseLeave = Image1MouseLeave + OnMouseMove = Image1MouseMove OnMouseUp = Image1MouseUp Picture.Data = { 1754506F727461626C654E6574776F726B477261706869636B7A020089504E47 @@ -5444,12 +5447,12 @@ object GUIForm: TGUIForm end object embedPanel: TPanel Left = 0 - Height = 567 + Height = 534 Top = 0 Width = 908 Align = alClient BevelOuter = bvNone - ClientHeight = 567 + ClientHeight = 534 ClientWidth = 908 Color = clBlack Font.Color = clWhite @@ -5461,7 +5464,7 @@ object GUIForm: TGUIForm OnMouseUp = FormMouseUp object backdrop: TImage Left = 0 - Height = 567 + Height = 534 Top = 0 Width = 908 Align = alClient @@ -5474,7 +5477,7 @@ object GUIForm: TGUIForm object pnlMemory: TPanel Left = 0 Height = 37 - Top = 567 + Top = 534 Width = 1078 Align = alBottom ClientHeight = 37 diff --git a/main.pas b/main.pas index 278184c..edc07fa 100644 --- a/main.pas +++ b/main.pas @@ -345,6 +345,7 @@ type procedure FormCloseQuery(Sender: TObject; var CanClose: boolean); procedure FormCreate(Sender: TObject); procedure FormDeactivate(Sender: TObject); + procedure FormDropFiles(Sender: TObject; const FileNames: array of String); procedure FormHide(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormKeyPress(Sender: TObject; var Key: char); @@ -363,6 +364,9 @@ type procedure Image1DragDrop(Sender, Source: TObject; X, Y: Integer); procedure Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Image1MouseLeave(Sender: TObject); + procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer + ); procedure Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure InputClick(Sender: TObject); @@ -588,6 +592,7 @@ type VolDrag, WarpDrag: boolean; Caps: boolean; NeedsRestart, Quitting: boolean; + sbx, sby, sbButton: longint; public procedure AppActivate(Sender: TObject); procedure AppDeactivate(Sender: TObject); @@ -737,6 +742,19 @@ begin // nothing much end; +procedure TGUIForm.Image1MouseLeave(Sender: TObject); +begin + sbx := -1; + sby := -1; +end; + +procedure TGUIForm.Image1MouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + sbx := x; + sby := y; +end; + procedure TGUIForm.Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var @@ -1894,6 +1912,22 @@ begin //StatusBar1.SimpleText := StatusBar1.SimpleText + ' (in window)'; SendMouseState( x - longint(p.X), y - longint(p.Y) ); end; + + { Now see if we are over the sidecar } + p := sidecarPanel.ClientToScreen(q); + if (x >= longint(p.X)) and (x < longint(p.X)+longint(sidecarPanel.Width)) and + (y >= longint(p.Y)) and (y < longint(p.Y)+longint(sidecarPanel.Height)) then + begin + sbx := x - p.X; + sby := y - p.Y; + sbButton := sby div Round(sidecarPanel.Height/5); + end + else + begin + sbx := -1; + sby := -1; + sbButton := -1; + end; end; end; @@ -2835,6 +2869,38 @@ begin lastFocusLostTime:=Now(); end; +procedure TGUIForm.FormDropFiles(Sender: TObject; + const FileNames: array of String); +var + filename, ext: string; +begin + //StatusBar1.SimpleText := IntToStr(sbButton) + ':' + FileNames[0]; + filename := FileNames[0]; + ext := ExtractFileExt(filename); + case sbButton of + 0, 1: begin + case ext of + '.dsk', '.do', '.po', '.woz', '.nib': begin + // insert disk here + InsertDisk( 'local:'+filename, sbButton ); + ShowM8; + SendOSDMessage('Disk Insert to Drive '+IntToStr(sbButton+1)); + end; + end; + end; + 3: begin + case ext of + '.po', '.2mg', '.hdv': begin + // insert smartport here + InsertDisk( 'local:'+filename, 2 ); + ShowM8; + SendOSDMessage('SmartPort Volume Connected'); + end; + end; + end; + end; +end; + procedure TGUIForm.FormHide(Sender: TObject); begin RepaintWindow; diff --git a/poc.lps b/poc.lps index 1c96fab..99f2a1a 100644 --- a/poc.lps +++ b/poc.lps @@ -21,8 +21,8 @@ - - + + @@ -43,7 +43,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -61,129 +61,129 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +