diff --git a/Projects/lape-wrappers/main.lfm b/Projects/lape-wrappers/main.lfm new file mode 100644 index 0000000..aa9b137 --- /dev/null +++ b/Projects/lape-wrappers/main.lfm @@ -0,0 +1,2226 @@ +object frmMain: TfrmMain + Left = 367 + Height = 419 + Top = 147 + Width = 708 + Caption = 'Wrap da Wrap' + ClientHeight = 419 + ClientWidth = 708 + LCLVersion = '0.9.29' + inline eIn: TSynEdit + Left = 0 + Height = 224 + Top = 0 + Width = 335 + Align = alClient + Font.Height = -13 + Font.Name = 'Courier New' + Font.Pitch = fpFixed + Font.Quality = fqNonAntialiased + ParentColor = False + ParentFont = False + TabOrder = 0 + Gutter.Width = 57 + Gutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + RightGutter.Width = 0 + RightGutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Highlighter = PasHL + Keystrokes = < + item + Command = ecUp + ShortCut = 38 + end + item + Command = ecSelUp + ShortCut = 8230 + end + item + Command = ecScrollUp + ShortCut = 16422 + end + item + Command = ecDown + ShortCut = 40 + end + item + Command = ecSelDown + ShortCut = 8232 + end + item + Command = ecScrollDown + ShortCut = 16424 + end + item + Command = ecLeft + ShortCut = 37 + end + item + Command = ecSelLeft + ShortCut = 8229 + end + item + Command = ecWordLeft + ShortCut = 16421 + end + item + Command = ecSelWordLeft + ShortCut = 24613 + end + item + Command = ecRight + ShortCut = 39 + end + item + Command = ecSelRight + ShortCut = 8231 + end + item + Command = ecWordRight + ShortCut = 16423 + end + item + Command = ecSelWordRight + ShortCut = 24615 + end + item + Command = ecPageDown + ShortCut = 34 + end + item + Command = ecSelPageDown + ShortCut = 8226 + end + item + Command = ecPageBottom + ShortCut = 16418 + end + item + Command = ecSelPageBottom + ShortCut = 24610 + end + item + Command = ecPageUp + ShortCut = 33 + end + item + Command = ecSelPageUp + ShortCut = 8225 + end + item + Command = ecPageTop + ShortCut = 16417 + end + item + Command = ecSelPageTop + ShortCut = 24609 + end + item + Command = ecLineStart + ShortCut = 36 + end + item + Command = ecSelLineStart + ShortCut = 8228 + end + item + Command = ecEditorTop + ShortCut = 16420 + end + item + Command = ecSelEditorTop + ShortCut = 24612 + end + item + Command = ecLineEnd + ShortCut = 35 + end + item + Command = ecSelLineEnd + ShortCut = 8227 + end + item + Command = ecEditorBottom + ShortCut = 16419 + end + item + Command = ecSelEditorBottom + ShortCut = 24611 + end + item + Command = ecToggleMode + ShortCut = 45 + end + item + Command = ecCopy + ShortCut = 16429 + end + item + Command = ecPaste + ShortCut = 8237 + end + item + Command = ecDeleteChar + ShortCut = 46 + end + item + Command = ecCut + ShortCut = 8238 + end + item + Command = ecDeleteLastChar + ShortCut = 8 + end + item + Command = ecDeleteLastChar + ShortCut = 8200 + end + item + Command = ecDeleteLastWord + ShortCut = 16392 + end + item + Command = ecUndo + ShortCut = 32776 + end + item + Command = ecRedo + ShortCut = 40968 + end + item + Command = ecLineBreak + ShortCut = 13 + end + item + Command = ecSelectAll + ShortCut = 16449 + end + item + Command = ecCopy + ShortCut = 16451 + end + item + Command = ecBlockIndent + ShortCut = 24649 + end + item + Command = ecLineBreak + ShortCut = 16461 + end + item + Command = ecInsertLine + ShortCut = 16462 + end + item + Command = ecDeleteWord + ShortCut = 16468 + end + item + Command = ecBlockUnindent + ShortCut = 24661 + end + item + Command = ecPaste + ShortCut = 16470 + end + item + Command = ecCut + ShortCut = 16472 + end + item + Command = ecDeleteLine + ShortCut = 16473 + end + item + Command = ecDeleteEOL + ShortCut = 24665 + end + item + Command = ecUndo + ShortCut = 16474 + end + item + Command = ecRedo + ShortCut = 24666 + end + item + Command = ecGotoMarker0 + ShortCut = 16432 + end + item + Command = ecGotoMarker1 + ShortCut = 16433 + end + item + Command = ecGotoMarker2 + ShortCut = 16434 + end + item + Command = ecGotoMarker3 + ShortCut = 16435 + end + item + Command = ecGotoMarker4 + ShortCut = 16436 + end + item + Command = ecGotoMarker5 + ShortCut = 16437 + end + item + Command = ecGotoMarker6 + ShortCut = 16438 + end + item + Command = ecGotoMarker7 + ShortCut = 16439 + end + item + Command = ecGotoMarker8 + ShortCut = 16440 + end + item + Command = ecGotoMarker9 + ShortCut = 16441 + end + item + Command = ecSetMarker0 + ShortCut = 24624 + end + item + Command = ecSetMarker1 + ShortCut = 24625 + end + item + Command = ecSetMarker2 + ShortCut = 24626 + end + item + Command = ecSetMarker3 + ShortCut = 24627 + end + item + Command = ecSetMarker4 + ShortCut = 24628 + end + item + Command = ecSetMarker5 + ShortCut = 24629 + end + item + Command = ecSetMarker6 + ShortCut = 24630 + end + item + Command = ecSetMarker7 + ShortCut = 24631 + end + item + Command = ecSetMarker8 + ShortCut = 24632 + end + item + Command = ecSetMarker9 + ShortCut = 24633 + end + item + Command = EcFoldLevel1 + ShortCut = 41009 + end + item + Command = EcFoldLevel2 + ShortCut = 41010 + end + item + Command = EcFoldLevel1 + ShortCut = 41011 + end + item + Command = EcFoldLevel1 + ShortCut = 41012 + end + item + Command = EcFoldLevel1 + ShortCut = 41013 + end + item + Command = EcFoldLevel6 + ShortCut = 41014 + end + item + Command = EcFoldLevel7 + ShortCut = 41015 + end + item + Command = EcFoldLevel8 + ShortCut = 41016 + end + item + Command = EcFoldLevel9 + ShortCut = 41017 + end + item + Command = EcFoldLevel0 + ShortCut = 41008 + end + item + Command = EcFoldCurrent + ShortCut = 41005 + end + item + Command = EcUnFoldCurrent + ShortCut = 41003 + end + item + Command = EcToggleMarkupWord + ShortCut = 32845 + end + item + Command = ecNormalSelect + ShortCut = 24654 + end + item + Command = ecColumnSelect + ShortCut = 24643 + end + item + Command = ecLineSelect + ShortCut = 24652 + end + item + Command = ecTab + ShortCut = 9 + end + item + Command = ecShiftTab + ShortCut = 8201 + end + item + Command = ecMatchBracket + ShortCut = 24642 + end + item + Command = ecColSelUp + ShortCut = 40998 + end + item + Command = ecColSelDown + ShortCut = 41000 + end + item + Command = ecColSelLeft + ShortCut = 40997 + end + item + Command = ecColSelRight + ShortCut = 40999 + end + item + Command = ecColSelPageDown + ShortCut = 40994 + end + item + Command = ecColSelPageBottom + ShortCut = 57378 + end + item + Command = ecColSelPageUp + ShortCut = 40993 + end + item + Command = ecColSelPageTop + ShortCut = 57377 + end + item + Command = ecColSelLineStart + ShortCut = 40996 + end + item + Command = ecColSelLineEnd + ShortCut = 40995 + end + item + Command = ecColSelEditorTop + ShortCut = 57380 + end + item + Command = ecColSelEditorBottom + ShortCut = 57379 + end> + MouseActions = < + item + Shift = [] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift, ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccDouble + ClickDir = cdDown + Command = 6 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccTriple + ClickDir = cdDown + Command = 7 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccQuad + ClickDir = cdDown + Command = 8 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbMiddle + ClickCount = ccSingle + ClickDir = cdDown + Command = 10 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssCtrl] + ShiftMask = [ssShift, ssAlt, ssCtrl] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdUp + Command = 11 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseSelActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 9 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Lines.Strings = ( + 'Input' + ) + BracketHighlightStyle = sbhsBoth + inline SynLeftGutterPartList1: TSynGutterPartList + object SynGutterMarks1: TSynGutterMarks + Width = 24 + end + object SynGutterLineNumber1: TSynGutterLineNumber + Width = 17 + MouseActions = <> + MarkupInfo.Background = clBtnFace + MarkupInfo.Foreground = clNone + DigitCount = 2 + ShowOnlyLineNumbersMultiplesOf = 1 + ZeroStart = False + LeadingZeros = False + end + object SynGutterChanges1: TSynGutterChanges + Width = 4 + ModifiedColor = 59900 + SavedColor = clGreen + end + object SynGutterSeparator1: TSynGutterSeparator + Width = 2 + end + object SynGutterCodeFolding1: TSynGutterCodeFolding + MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 16 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 0 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MarkupInfo.Background = clNone + MarkupInfo.Foreground = clGray + MouseActionsExpanded = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseActionsCollapsed = < + item + Shift = [ssCtrl] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 1 + Priority = 0 + end> + end + end + inline SynRightGutterPartList1: TSynRightGutterPartList + end + end + inline eOut: TSynEdit + Left = 340 + Height = 224 + Top = 0 + Width = 368 + Align = alRight + Font.Height = -13 + Font.Name = 'Courier New' + Font.Pitch = fpFixed + Font.Quality = fqNonAntialiased + ParentColor = False + ParentFont = False + TabOrder = 1 + Gutter.Width = 57 + Gutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + RightGutter.Width = 0 + RightGutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Highlighter = PasHL + Keystrokes = < + item + Command = ecUp + ShortCut = 38 + end + item + Command = ecSelUp + ShortCut = 8230 + end + item + Command = ecScrollUp + ShortCut = 16422 + end + item + Command = ecDown + ShortCut = 40 + end + item + Command = ecSelDown + ShortCut = 8232 + end + item + Command = ecScrollDown + ShortCut = 16424 + end + item + Command = ecLeft + ShortCut = 37 + end + item + Command = ecSelLeft + ShortCut = 8229 + end + item + Command = ecWordLeft + ShortCut = 16421 + end + item + Command = ecSelWordLeft + ShortCut = 24613 + end + item + Command = ecRight + ShortCut = 39 + end + item + Command = ecSelRight + ShortCut = 8231 + end + item + Command = ecWordRight + ShortCut = 16423 + end + item + Command = ecSelWordRight + ShortCut = 24615 + end + item + Command = ecPageDown + ShortCut = 34 + end + item + Command = ecSelPageDown + ShortCut = 8226 + end + item + Command = ecPageBottom + ShortCut = 16418 + end + item + Command = ecSelPageBottom + ShortCut = 24610 + end + item + Command = ecPageUp + ShortCut = 33 + end + item + Command = ecSelPageUp + ShortCut = 8225 + end + item + Command = ecPageTop + ShortCut = 16417 + end + item + Command = ecSelPageTop + ShortCut = 24609 + end + item + Command = ecLineStart + ShortCut = 36 + end + item + Command = ecSelLineStart + ShortCut = 8228 + end + item + Command = ecEditorTop + ShortCut = 16420 + end + item + Command = ecSelEditorTop + ShortCut = 24612 + end + item + Command = ecLineEnd + ShortCut = 35 + end + item + Command = ecSelLineEnd + ShortCut = 8227 + end + item + Command = ecEditorBottom + ShortCut = 16419 + end + item + Command = ecSelEditorBottom + ShortCut = 24611 + end + item + Command = ecToggleMode + ShortCut = 45 + end + item + Command = ecCopy + ShortCut = 16429 + end + item + Command = ecPaste + ShortCut = 8237 + end + item + Command = ecDeleteChar + ShortCut = 46 + end + item + Command = ecCut + ShortCut = 8238 + end + item + Command = ecDeleteLastChar + ShortCut = 8 + end + item + Command = ecDeleteLastChar + ShortCut = 8200 + end + item + Command = ecDeleteLastWord + ShortCut = 16392 + end + item + Command = ecUndo + ShortCut = 32776 + end + item + Command = ecRedo + ShortCut = 40968 + end + item + Command = ecLineBreak + ShortCut = 13 + end + item + Command = ecSelectAll + ShortCut = 16449 + end + item + Command = ecCopy + ShortCut = 16451 + end + item + Command = ecBlockIndent + ShortCut = 24649 + end + item + Command = ecLineBreak + ShortCut = 16461 + end + item + Command = ecInsertLine + ShortCut = 16462 + end + item + Command = ecDeleteWord + ShortCut = 16468 + end + item + Command = ecBlockUnindent + ShortCut = 24661 + end + item + Command = ecPaste + ShortCut = 16470 + end + item + Command = ecCut + ShortCut = 16472 + end + item + Command = ecDeleteLine + ShortCut = 16473 + end + item + Command = ecDeleteEOL + ShortCut = 24665 + end + item + Command = ecUndo + ShortCut = 16474 + end + item + Command = ecRedo + ShortCut = 24666 + end + item + Command = ecGotoMarker0 + ShortCut = 16432 + end + item + Command = ecGotoMarker1 + ShortCut = 16433 + end + item + Command = ecGotoMarker2 + ShortCut = 16434 + end + item + Command = ecGotoMarker3 + ShortCut = 16435 + end + item + Command = ecGotoMarker4 + ShortCut = 16436 + end + item + Command = ecGotoMarker5 + ShortCut = 16437 + end + item + Command = ecGotoMarker6 + ShortCut = 16438 + end + item + Command = ecGotoMarker7 + ShortCut = 16439 + end + item + Command = ecGotoMarker8 + ShortCut = 16440 + end + item + Command = ecGotoMarker9 + ShortCut = 16441 + end + item + Command = ecSetMarker0 + ShortCut = 24624 + end + item + Command = ecSetMarker1 + ShortCut = 24625 + end + item + Command = ecSetMarker2 + ShortCut = 24626 + end + item + Command = ecSetMarker3 + ShortCut = 24627 + end + item + Command = ecSetMarker4 + ShortCut = 24628 + end + item + Command = ecSetMarker5 + ShortCut = 24629 + end + item + Command = ecSetMarker6 + ShortCut = 24630 + end + item + Command = ecSetMarker7 + ShortCut = 24631 + end + item + Command = ecSetMarker8 + ShortCut = 24632 + end + item + Command = ecSetMarker9 + ShortCut = 24633 + end + item + Command = EcFoldLevel1 + ShortCut = 41009 + end + item + Command = EcFoldLevel2 + ShortCut = 41010 + end + item + Command = EcFoldLevel1 + ShortCut = 41011 + end + item + Command = EcFoldLevel1 + ShortCut = 41012 + end + item + Command = EcFoldLevel1 + ShortCut = 41013 + end + item + Command = EcFoldLevel6 + ShortCut = 41014 + end + item + Command = EcFoldLevel7 + ShortCut = 41015 + end + item + Command = EcFoldLevel8 + ShortCut = 41016 + end + item + Command = EcFoldLevel9 + ShortCut = 41017 + end + item + Command = EcFoldLevel0 + ShortCut = 41008 + end + item + Command = EcFoldCurrent + ShortCut = 41005 + end + item + Command = EcUnFoldCurrent + ShortCut = 41003 + end + item + Command = EcToggleMarkupWord + ShortCut = 32845 + end + item + Command = ecNormalSelect + ShortCut = 24654 + end + item + Command = ecColumnSelect + ShortCut = 24643 + end + item + Command = ecLineSelect + ShortCut = 24652 + end + item + Command = ecTab + ShortCut = 9 + end + item + Command = ecShiftTab + ShortCut = 8201 + end + item + Command = ecMatchBracket + ShortCut = 24642 + end + item + Command = ecColSelUp + ShortCut = 40998 + end + item + Command = ecColSelDown + ShortCut = 41000 + end + item + Command = ecColSelLeft + ShortCut = 40997 + end + item + Command = ecColSelRight + ShortCut = 40999 + end + item + Command = ecColSelPageDown + ShortCut = 40994 + end + item + Command = ecColSelPageBottom + ShortCut = 57378 + end + item + Command = ecColSelPageUp + ShortCut = 40993 + end + item + Command = ecColSelPageTop + ShortCut = 57377 + end + item + Command = ecColSelLineStart + ShortCut = 40996 + end + item + Command = ecColSelLineEnd + ShortCut = 40995 + end + item + Command = ecColSelEditorTop + ShortCut = 57380 + end + item + Command = ecColSelEditorBottom + ShortCut = 57379 + end> + MouseActions = < + item + Shift = [] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift, ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccDouble + ClickDir = cdDown + Command = 6 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccTriple + ClickDir = cdDown + Command = 7 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccQuad + ClickDir = cdDown + Command = 8 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbMiddle + ClickCount = ccSingle + ClickDir = cdDown + Command = 10 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssCtrl] + ShiftMask = [ssShift, ssAlt, ssCtrl] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdUp + Command = 11 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseSelActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 9 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Lines.Strings = ( + 'Output' + ) + BracketHighlightStyle = sbhsBoth + inline SynLeftGutterPartList1: TSynGutterPartList + object SynGutterMarks1: TSynGutterMarks + Width = 24 + end + object SynGutterLineNumber1: TSynGutterLineNumber + Width = 17 + MouseActions = <> + MarkupInfo.Background = clBtnFace + MarkupInfo.Foreground = clNone + DigitCount = 2 + ShowOnlyLineNumbersMultiplesOf = 1 + ZeroStart = False + LeadingZeros = False + end + object SynGutterChanges1: TSynGutterChanges + Width = 4 + ModifiedColor = 59900 + SavedColor = clGreen + end + object SynGutterSeparator1: TSynGutterSeparator + Width = 2 + end + object SynGutterCodeFolding1: TSynGutterCodeFolding + MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 16 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 0 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MarkupInfo.Background = clNone + MarkupInfo.Foreground = clGray + MouseActionsExpanded = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseActionsCollapsed = < + item + Shift = [ssCtrl] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 1 + Priority = 0 + end> + end + end + inline SynRightGutterPartList1: TSynRightGutterPartList + end + end + object pnlMain: TPanel + Left = 0 + Height = 190 + Top = 229 + Width = 708 + Align = alBottom + ClientHeight = 190 + ClientWidth = 708 + TabOrder = 2 + object btnGo: TButton + Left = 8 + Height = 25 + Top = 5 + Width = 75 + Caption = 'Go!' + OnClick = btnGoClick + TabOrder = 0 + end + inline eDebug: TSynEdit + Left = 2 + Height = 150 + Top = 40 + Width = 706 + Align = alCustom + Anchors = [akTop, akLeft, akRight, akBottom] + Font.Height = -13 + Font.Name = 'Courier New' + Font.Pitch = fpFixed + Font.Quality = fqNonAntialiased + ParentColor = False + ParentFont = False + TabOrder = 1 + Gutter.Width = 57 + Gutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + RightGutter.Width = 0 + RightGutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Keystrokes = < + item + Command = ecUp + ShortCut = 38 + end + item + Command = ecSelUp + ShortCut = 8230 + end + item + Command = ecScrollUp + ShortCut = 16422 + end + item + Command = ecDown + ShortCut = 40 + end + item + Command = ecSelDown + ShortCut = 8232 + end + item + Command = ecScrollDown + ShortCut = 16424 + end + item + Command = ecLeft + ShortCut = 37 + end + item + Command = ecSelLeft + ShortCut = 8229 + end + item + Command = ecWordLeft + ShortCut = 16421 + end + item + Command = ecSelWordLeft + ShortCut = 24613 + end + item + Command = ecRight + ShortCut = 39 + end + item + Command = ecSelRight + ShortCut = 8231 + end + item + Command = ecWordRight + ShortCut = 16423 + end + item + Command = ecSelWordRight + ShortCut = 24615 + end + item + Command = ecPageDown + ShortCut = 34 + end + item + Command = ecSelPageDown + ShortCut = 8226 + end + item + Command = ecPageBottom + ShortCut = 16418 + end + item + Command = ecSelPageBottom + ShortCut = 24610 + end + item + Command = ecPageUp + ShortCut = 33 + end + item + Command = ecSelPageUp + ShortCut = 8225 + end + item + Command = ecPageTop + ShortCut = 16417 + end + item + Command = ecSelPageTop + ShortCut = 24609 + end + item + Command = ecLineStart + ShortCut = 36 + end + item + Command = ecSelLineStart + ShortCut = 8228 + end + item + Command = ecEditorTop + ShortCut = 16420 + end + item + Command = ecSelEditorTop + ShortCut = 24612 + end + item + Command = ecLineEnd + ShortCut = 35 + end + item + Command = ecSelLineEnd + ShortCut = 8227 + end + item + Command = ecEditorBottom + ShortCut = 16419 + end + item + Command = ecSelEditorBottom + ShortCut = 24611 + end + item + Command = ecToggleMode + ShortCut = 45 + end + item + Command = ecCopy + ShortCut = 16429 + end + item + Command = ecPaste + ShortCut = 8237 + end + item + Command = ecDeleteChar + ShortCut = 46 + end + item + Command = ecCut + ShortCut = 8238 + end + item + Command = ecDeleteLastChar + ShortCut = 8 + end + item + Command = ecDeleteLastChar + ShortCut = 8200 + end + item + Command = ecDeleteLastWord + ShortCut = 16392 + end + item + Command = ecUndo + ShortCut = 32776 + end + item + Command = ecRedo + ShortCut = 40968 + end + item + Command = ecLineBreak + ShortCut = 13 + end + item + Command = ecSelectAll + ShortCut = 16449 + end + item + Command = ecCopy + ShortCut = 16451 + end + item + Command = ecBlockIndent + ShortCut = 24649 + end + item + Command = ecLineBreak + ShortCut = 16461 + end + item + Command = ecInsertLine + ShortCut = 16462 + end + item + Command = ecDeleteWord + ShortCut = 16468 + end + item + Command = ecBlockUnindent + ShortCut = 24661 + end + item + Command = ecPaste + ShortCut = 16470 + end + item + Command = ecCut + ShortCut = 16472 + end + item + Command = ecDeleteLine + ShortCut = 16473 + end + item + Command = ecDeleteEOL + ShortCut = 24665 + end + item + Command = ecUndo + ShortCut = 16474 + end + item + Command = ecRedo + ShortCut = 24666 + end + item + Command = ecGotoMarker0 + ShortCut = 16432 + end + item + Command = ecGotoMarker1 + ShortCut = 16433 + end + item + Command = ecGotoMarker2 + ShortCut = 16434 + end + item + Command = ecGotoMarker3 + ShortCut = 16435 + end + item + Command = ecGotoMarker4 + ShortCut = 16436 + end + item + Command = ecGotoMarker5 + ShortCut = 16437 + end + item + Command = ecGotoMarker6 + ShortCut = 16438 + end + item + Command = ecGotoMarker7 + ShortCut = 16439 + end + item + Command = ecGotoMarker8 + ShortCut = 16440 + end + item + Command = ecGotoMarker9 + ShortCut = 16441 + end + item + Command = ecSetMarker0 + ShortCut = 24624 + end + item + Command = ecSetMarker1 + ShortCut = 24625 + end + item + Command = ecSetMarker2 + ShortCut = 24626 + end + item + Command = ecSetMarker3 + ShortCut = 24627 + end + item + Command = ecSetMarker4 + ShortCut = 24628 + end + item + Command = ecSetMarker5 + ShortCut = 24629 + end + item + Command = ecSetMarker6 + ShortCut = 24630 + end + item + Command = ecSetMarker7 + ShortCut = 24631 + end + item + Command = ecSetMarker8 + ShortCut = 24632 + end + item + Command = ecSetMarker9 + ShortCut = 24633 + end + item + Command = EcFoldLevel1 + ShortCut = 41009 + end + item + Command = EcFoldLevel2 + ShortCut = 41010 + end + item + Command = EcFoldLevel1 + ShortCut = 41011 + end + item + Command = EcFoldLevel1 + ShortCut = 41012 + end + item + Command = EcFoldLevel1 + ShortCut = 41013 + end + item + Command = EcFoldLevel6 + ShortCut = 41014 + end + item + Command = EcFoldLevel7 + ShortCut = 41015 + end + item + Command = EcFoldLevel8 + ShortCut = 41016 + end + item + Command = EcFoldLevel9 + ShortCut = 41017 + end + item + Command = EcFoldLevel0 + ShortCut = 41008 + end + item + Command = EcFoldCurrent + ShortCut = 41005 + end + item + Command = EcUnFoldCurrent + ShortCut = 41003 + end + item + Command = EcToggleMarkupWord + ShortCut = 32845 + end + item + Command = ecNormalSelect + ShortCut = 24654 + end + item + Command = ecColumnSelect + ShortCut = 24643 + end + item + Command = ecLineSelect + ShortCut = 24652 + end + item + Command = ecTab + ShortCut = 9 + end + item + Command = ecShiftTab + ShortCut = 8201 + end + item + Command = ecMatchBracket + ShortCut = 24642 + end + item + Command = ecColSelUp + ShortCut = 40998 + end + item + Command = ecColSelDown + ShortCut = 41000 + end + item + Command = ecColSelLeft + ShortCut = 40997 + end + item + Command = ecColSelRight + ShortCut = 40999 + end + item + Command = ecColSelPageDown + ShortCut = 40994 + end + item + Command = ecColSelPageBottom + ShortCut = 57378 + end + item + Command = ecColSelPageUp + ShortCut = 40993 + end + item + Command = ecColSelPageTop + ShortCut = 57377 + end + item + Command = ecColSelLineStart + ShortCut = 40996 + end + item + Command = ecColSelLineEnd + ShortCut = 40995 + end + item + Command = ecColSelEditorTop + ShortCut = 57380 + end + item + Command = ecColSelEditorBottom + ShortCut = 57379 + end> + MouseActions = < + item + Shift = [] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift, ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccDouble + ClickDir = cdDown + Command = 6 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccTriple + ClickDir = cdDown + Command = 7 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccQuad + ClickDir = cdDown + Command = 8 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbMiddle + ClickCount = ccSingle + ClickDir = cdDown + Command = 10 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssCtrl] + ShiftMask = [ssShift, ssAlt, ssCtrl] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdUp + Command = 11 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseSelActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 9 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Lines.Strings = ( + 'Debug' + ) + BracketHighlightStyle = sbhsBoth + inline SynLeftGutterPartList1: TSynGutterPartList + object SynGutterMarks1: TSynGutterMarks + Width = 24 + end + object SynGutterLineNumber1: TSynGutterLineNumber + Width = 17 + MouseActions = <> + MarkupInfo.Background = clBtnFace + MarkupInfo.Foreground = clNone + DigitCount = 2 + ShowOnlyLineNumbersMultiplesOf = 1 + ZeroStart = False + LeadingZeros = False + end + object SynGutterChanges1: TSynGutterChanges + Width = 4 + ModifiedColor = 59900 + SavedColor = clGreen + end + object SynGutterSeparator1: TSynGutterSeparator + Width = 2 + end + object SynGutterCodeFolding1: TSynGutterCodeFolding + MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 16 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 0 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MarkupInfo.Background = clNone + MarkupInfo.Foreground = clGray + MouseActionsExpanded = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseActionsCollapsed = < + item + Shift = [ssCtrl] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 1 + Priority = 0 + end> + end + end + inline SynRightGutterPartList1: TSynRightGutterPartList + end + end + object btnAdvanced: TButton + Left = 544 + Height = 25 + Top = 5 + Width = 80 + Caption = 'Advanced' + OnClick = btnAdvancedClick + TabOrder = 2 + end + end + object Splitter1: TSplitter + Left = 335 + Height = 224 + Top = 0 + Width = 5 + Align = alRight + ResizeAnchor = akRight + end + object Splitter2: TSplitter + Cursor = crVSplit + Left = 0 + Height = 5 + Top = 224 + Width = 708 + Align = alBottom + ResizeAnchor = akBottom + end + object PasHL: TSynPasSyn + Enabled = False + CommentAttri.Foreground = clGreen + NumberAttri.Foreground = clNavy + StringAttri.Foreground = clPurple + SymbolAttri.Foreground = clMaroon + CaseLabelAttri.Style = [fsItalic] + DirectiveAttri.Foreground = clOlive + CompilerMode = pcmDelphi + NestedComments = False + end +end diff --git a/Projects/lape-wrappers/main.pas b/Projects/lape-wrappers/main.pas new file mode 100644 index 0000000..ffcfdea --- /dev/null +++ b/Projects/lape-wrappers/main.pas @@ -0,0 +1,201 @@ +unit main; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, + StdCtrls, SynEdit, SynHighlighterPas,wrapfiles; + +type + + { TfrmMain } + + TfrmMain = class(TForm) + btnGo: TButton; + btnAdvanced: TButton; + pnlMain: TPanel; + Splitter1: TSplitter; + Splitter2: TSplitter; + eIn: TSynEdit; + eOut: TSynEdit; + eDebug: TSynEdit; + PasHL: TSynPasSyn; + procedure btnAdvancedClick(Sender: TObject); + procedure btnGoClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; +procedure ConvertRT(Input, Dbg, Output : TStrings; procnames : TStrings = nil); +var + frmMain: TfrmMain; + +implementation + +uses + v_ideCodeParser; + +{$R *.lfm} + +{ TfrmMain } + +procedure ConvertRT(Input, Dbg, Output : TStrings; procnames : TStrings = nil); + procedure Debug(s: string); overload; + begin + if (Trim(Output.Text) <> '') then + Dbg.Append(s) + else + Dbg.Text := s; + end; + + procedure Debug(v: Variant); overload; + begin + Debug(string(v)); + end; + + procedure Write(s: string); overload; + begin + if (Trim(Output.Text) <> '') then + Output.Text := Output.Text + s + else + Output.Text := s; + end; + + procedure Write(v: Variant); overload; + begin + Write(string(v)); + end; + + function FixName( str : string) : string; + begin + if (length(str) > 3) and (str[1] = 'p') and (str[2] = 's') and (str[3] = '_') then + result := Copy(str,4,length(str)-3); + end; + + function PtrName ( str : string) : String; + begin + debug(str); + if (length(str) > 1) and (str[1] in ['T','t']) then + result := 'P' + copy(str,2,length(str)-1) + else + result := 'P' + str; + debug(result); + end; + +var + p: TCodeParser; + m: TMemoryStream; + a, b, c: TDeclarationArray; + i, ii, iii: Integer; + s: string; + rutiss,tmp : string; + d: TDeclaration; + Fail: Boolean; +begin + p := TCodeParser.Create; + m := TMemoryStream.Create; + + try + Output.BeginUpdate; + Output.Clear; + Dbg.BeginUpdate; + Dbg.Clear; + + Input.SaveToStream(m); + + try + p.Run(m); + except on E : Exception do + Debug(e.Message); + end; + + a := p.Items.GetItemsOfClass(TciProcedureDeclaration); + Debug('Start converting '+IntToStr(Length(a))+' methods!'); + for i := 0 to High(a) do + with TciProcedureDeclaration(a[i]) do + begin + if (Name = nil) then + begin + Debug('No name found, skipping..'); + Continue; + end; + + d := Items.GetFirstItemOfClass(TciReturnType); + if (d <> nil) then + begin + s := 'procedure Lape_'+FixName(Name.ShortText)+ + '(const Params: PParamArray; const Result: Pointer);'+LineEnding+ + 'begin'+LineEnding+ + ' '+PtrName(d.ShortText)+'(Result)^ := '; + end else + begin + s := 'procedure Lape_'+FixName(Name.ShortText)+'(const Params: PParamArray);'+LineEnding+ + 'begin'+LineEnding+' '; + end; + s := s+Name.ShortText+'('; + + Fail := False; + b := GetParamDeclarations(); + for ii := 0 to High(b) do + begin + d := b[ii].Items.GetFirstItemOfClass(TciParameterType); + if (d = nil) then + begin + Debug('No parameter type found in '+Name.ShortText+', skipping..'); + Fail := True; + Break; + end; + c := b[ii].Items.GetItemsOfClass(TciParameterName); + if (Length(c) < 1) then + begin + Debug('No parameter names found in '+Name.ShortText+', skipping..'); + Fail := True; + Break; + end; + + for iii := 0 to High(c) do + begin + if (iii> 0) then + s := s+', '; + s := s+PtrName(d.ShortText)+'(Params^['+IntToStr(iii)+'])^'; + end; + end; + + if Fail then + Continue; + + s := s+');'+LineEnding+'end;'; + if (i > 0) then + s := LineEnding+s; + Write(s); + if procnames <> nil then + procnames.Add('AddGlobalFunc('#39 + CleanDeclaration + #39', @Lape_'+FixName(name.ShortText)+');') + else + Debug('Prog-name "AddGlobalFunc('#39 + CleanDeclaration + #39', @Lape_'+FixName(name.ShortText)+');"'); + Debug('Done "'+Name.ShortText+'"!'); + end; + finally + m.Free; + p.Free; + + Output.EndUpdate; + Dbg.EndUpdate; + end; + Debug('Done :)'); +end; + +procedure TfrmMain.btnGoClick(Sender: TObject); +begin + ConvertRT(eIn.Lines,eDebug.Lines,eOut.Lines); +end; + +procedure TfrmMain.btnAdvancedClick(Sender: TObject); +begin + WrapFilesForm.ShowModal; +end; + +end. + diff --git a/Projects/lape-wrappers/ruwa.ico b/Projects/lape-wrappers/ruwa.ico new file mode 100644 index 0000000..0341321 Binary files /dev/null and b/Projects/lape-wrappers/ruwa.ico differ diff --git a/Projects/lape-wrappers/ruwa.lpi b/Projects/lape-wrappers/ruwa.lpi new file mode 100644 index 0000000..b30a17f --- /dev/null +++ b/Projects/lape-wrappers/ruwa.lpi @@ -0,0 +1,380 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/lape-wrappers/ruwa.lpr b/Projects/lape-wrappers/ruwa.lpr new file mode 100644 index 0000000..049bd79 --- /dev/null +++ b/Projects/lape-wrappers/ruwa.lpr @@ -0,0 +1,22 @@ +program ruwa; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, main, v_MiscFunctions, CastaliaPasLex, CastaliaPasLexTypes, + CastaliaSimplePasPar, CastaliaSimplePasParTypes, + v_Constants, v_ideCodeParser, wrapfiles; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TfrmMain, frmMain); + Application.CreateForm(TWrapFilesForm, WrapFilesForm); + Application.Run; +end. + diff --git a/Projects/lape-wrappers/wrapfiles.lfm b/Projects/lape-wrappers/wrapfiles.lfm new file mode 100644 index 0000000..9762268 --- /dev/null +++ b/Projects/lape-wrappers/wrapfiles.lfm @@ -0,0 +1,94 @@ +object WrapFilesForm: TWrapFilesForm + Left = 429 + Height = 398 + Top = 234 + Width = 652 + Caption = 'WrapFilesForm' + ClientHeight = 398 + ClientWidth = 652 + Constraints.MinHeight = 398 + Constraints.MinWidth = 652 + OnCreate = FormCreate + LCLVersion = '0.9.29' + object FileButton: TButton + Left = 16 + Height = 25 + Top = 16 + Width = 75 + Caption = 'Select files' + OnClick = FileButtonClick + TabOrder = 0 + end + object FileBox: TListBox + Left = 16 + Height = 220 + Top = 56 + Width = 616 + Anchors = [akTop, akLeft, akRight, akBottom] + ItemHeight = 0 + TabOrder = 1 + end + object SaveDirEdit: TDirectoryEdit + Left = 192 + Height = 21 + Top = 20 + Width = 152 + ShowHidden = False + ButtonWidth = 23 + NumGlyphs = 0 + MaxLength = 0 + TabOrder = 2 + end + object SaveDirLabel: TLabel + Left = 104 + Height = 14 + Top = 20 + Width = 78 + Caption = 'Save directory: ' + ParentColor = False + end + object wrpBtn: TButton + Left = 568 + Height = 25 + Top = 16 + Width = 75 + Caption = 'Convert' + OnClick = wrpBtnClick + TabOrder = 3 + end + object dbgMemo: TMemo + Left = 16 + Height = 100 + Top = 287 + Width = 616 + Anchors = [akRight, akBottom] + TabOrder = 4 + end + object FileNameEdit1: TFileNameEdit + Left = 448 + Height = 21 + Top = 20 + Width = 80 + DialogOptions = [] + FilterIndex = 0 + HideDirectories = False + ButtonWidth = 23 + NumGlyphs = 0 + MaxLength = 0 + TabOrder = 5 + end + object Label1: TLabel + Left = 383 + Height = 14 + Top = 25 + Width = 57 + Caption = 'MethodFile:' + ParentColor = False + end + object FileDialog: TOpenDialog + Filter = 'Include files (*.inc)|*.inc|All files (*.*)|*.*' + Options = [ofAllowMultiSelect, ofFileMustExist, ofEnableSizing, ofViewDetail] + left = 32 + top = 56 + end +end diff --git a/Projects/lape-wrappers/wrapfiles.pas b/Projects/lape-wrappers/wrapfiles.pas new file mode 100644 index 0000000..59d8553 --- /dev/null +++ b/Projects/lape-wrappers/wrapfiles.pas @@ -0,0 +1,127 @@ +unit wrapfiles; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, + EditBtn; + +type + + { TWrapFilesForm } + + TWrapFilesForm = class(TForm) + dbgMemo: TMemo; + FileNameEdit1: TFileNameEdit; + Label1: TLabel; + wrpBtn: TButton; + SaveDirEdit: TDirectoryEdit; + FileButton: TButton; + FileBox: TListBox; + FileDialog: TOpenDialog; + SaveDirLabel: TLabel; + procedure FileButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure wrpBtnClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + WrapFilesForm: TWrapFilesForm; + +implementation + +uses + Main; + +{$R *.lfm} + +{ TWrapFilesForm } + +procedure TWrapFilesForm.FileButtonClick(Sender: TObject); +begin + if FileDialog.Execute then + begin + SaveDirEdit.Directory := ExtractFileDir(FileDialog.FileName); + FileBox.Items.AddStrings(FileDialog.Files); + end; +end; + +procedure TWrapFilesForm.FormCreate(Sender: TObject); +begin +end; + +procedure TWrapFilesForm.wrpBtnClick(Sender: TObject); + procedure dbg(s : string); + begin + dbgMemo.Lines.Add(s); + end; + +var + i : integer; + Input, Output,Procnames : TStringList; + NewFile : string; + YesToAll, NoToAll : boolean; +begin + YesToAll:= false; + NoToAll:= false; + if not DirectoryExists(SaveDirEdit.Directory) then + begin + dbg(format('Dir %s does not exist',[SaveDirEdit.Directory])); + exit; + end; + if FileBox.Items.Count < 1 then + begin + dbg('No files loaded'); + exit; + end; + Procnames := TStringList.Create; + for i := 0 to FileBox.Items.Count - 1 do + begin + if not FileExists(filebox.items[i]) then + begin + dbg(format('File[%s] does not exist',[FileBox.items[i]])); + continue; + end; + NewFile := SaveDirEdit.Directory + DirectorySeparator + ExtractFileName(FileBox.Items[i]); + if not YesToAll and FileExists(NewFile) then + begin + if NoToAll then + Continue; + case MessageDlg('File already exists',Format('Do you want to overwrite the file %s',[NewFile]), + mtConfirmation,[mbYes,mbYesToAll,mbNo,mbNoToAll],0) of + mrNo : Continue; + mrNoToAll : begin + NoToAll:= True; + Continue; + end; + mrYesToAll : YesToAll:= true; + end; + dbg(BoolToStr(YesToAll,true)); + end; + dbg(NewFile); + try + Input := TStringList.Create; + Input.LoadFromFile(filebox.items[i]); + Output := TStringList.Create; + ConvertRT(Input,dbgMemo.Lines,Output,Procnames); + Output.SaveToFile(NewFile); + Input.free; + Output.free; + except + dbg('Something went wrong'); + end; + end; + dbg(Procnames.Text); + if FileNameEdit1.Text <> '' then + Procnames.SaveToFile(FileNameEdit1.text); + Procnames.Free; +end; + +end. +