Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/intellisense #1635

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Tools/VOXporter/Templates/template_XIDE.xiapp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ VO11=1
VO12=%option_intdiv%
VO13=1
VO14=1
VO15=1
VO16=1
LateBound=1
Unsafe=1
Expand Down
26 changes: 21 additions & 5 deletions src/VisualStudio/CodeGenerator/XIDE_CodeGenerator.prg
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ RETURN
LOCAL nTemp AS INT
LOCAL nFirst AS INT
LOCAL lIsUser AS LOGIC
LOCAL lRemoveFields AS LOGIC
LOCAL lRemoveFields AS LOGIC
LOCAL lSealed := FALSE AS LOGIC
LOCAL n AS INT

LOCAL cTab , ceTab AS STRING
Expand Down Expand Up @@ -379,6 +380,10 @@ RETURN
IF _AND(oDeclarationLine:oEntity:eModifiers , EntityModifiers._Internal) == EntityModifiers._Internal
cDeclarationLine := "INTERNAL " + cDeclarationLine
ENDIF
IF _AND(oDeclarationLine:oEntity:eModifiers , EntityModifiers._Sealed) == EntityModifiers._Sealed
cDeclarationLine := "SEALED " + cDeclarationLine
lSealed := TRUE
ENDIF
IF .NOT. String.IsNullOrEmpty( oDeclarationLine:oEntity:cImplements:Trim() )
cDeclarationLine := cDeclarationLine + " IMPLEMENTS " + oDeclarationLine:oEntity:cImplements
ENDIF
Expand All @@ -402,15 +407,26 @@ RETURN
n := 1
END IF

DO WHILE n < aEntity:Count
oLine := SELF:AddWEDLine(aEntity[n] , REF nLine)
DO WHILE n < aEntity:Count
LOCAL cLine AS STRING
cLine := aEntity[n]
IF eType == EntityType._Class .and. lSealed
IF cLine:Trim():ToUpperInvariant():StartsWith("PROTECT ")
LOCAL nIndex AS INT
nIndex := cLine:ToUpperInvariant():IndexOf("PROTECT ")
IF nIndex != - 1
cLine := cLine:Substring(0,nIndex) + "PRIVATE " + cLine:Substring(nIndex+8)
ENDIF
ENDIF
ENDIF
SELF:AddWEDLine(cLine , REF nLine)
n ++
END DO
IF (eOptions & EntityOptions.AddUser) == EntityOptions.AddUser
IF eType == EntityType._Class
oLine := SELF:AddWEDLine(ceTab + cUser + cTagU , REF nLine)
SELF:AddWEDLine(ceTab + cUser + cTagU , REF nLine)
ELSE
oLine := SELF:AddWEDLine(cTab + cUser + cTagU , REF nLine)
SELF:AddWEDLine(cTab + cUser + cTagU , REF nLine)
END IF
END IF

Expand Down
2 changes: 1 addition & 1 deletion src/VisualStudio/XSharpVoEditors/Designers/Base.prg
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ CLASS DesignerBase
VIRTUAL METHOD TimerTicked(o AS OBJECT,e AS EventArgs) AS VOID
// Check periodically if the WED is active and if not, hide the toolwindows
IF SELF:oGrid != NULL .and. SELF:oGrid:oActiveDesigner == SELF
IF !SELF:oSurface:ContainsFocus
IF .not. SELF:oSurface:ContainsFocus
SELF:ShowHideTools(FALSE)
ENDIF
ENDIF
Expand Down
52 changes: 44 additions & 8 deletions src/VisualStudio/XSharpVoEditors/Designers/ControlOrder.prg
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ CLASS VOControlCreationOrderDlg INHERIT System.Windows.Forms.Form
PROTECT lUsingMouse AS LOGIC
PROTECT oTimer AS Timer
PROTECT nMouseIndex AS INT
PROTECT cLastSelectedGuid := NULL AS STRING

CONSTRUCTOR(_oEditor AS VOWindowEditor , aDesign AS ArrayList)
CONSTRUCTOR(_oEditor AS VOWindowEditor , aDesign AS ArrayList, oSelected AS DesignWindowItem)

SUPER()

Expand Down Expand Up @@ -61,11 +62,15 @@ CLASS VOControlCreationOrderDlg INHERIT System.Windows.Forms.Form
oItem:SubItems:Add(oDesign:GetProperty("Caption"):TextValue)
ENDIF
SELF:oControlsList:Items:Add(oItem)
IF n == 0
oItem:Selected := TRUE
END IF
IF oDesign == oSelected
oItem:Selected := TRUE
END IF
NEXT

IF SELF:oControlsList:Items:Count != 0
SELF:oControlsList:Items[0]:Selected := TRUE
ENDIF
SELF:oControlsList:AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent)

SELF:oTimer := Timer{}
SELF:oTimer:Interval := 100
Expand Down Expand Up @@ -164,6 +169,9 @@ CLASS VOControlCreationOrderDlg INHERIT System.Windows.Forms.Form

RETURN


PROPERTY LastSelectedGuid AS STRING GET SELF:cLastSelectedGuid

METHOD ControlsListMouseDown(sender AS System.Object , e AS System.Windows.Forms.MouseEventArgs) AS System.Void
SELF:oDragItem := SELF:oControlsList:GetItemAt(e:X , e:Y)
IF SELF:oDragItem != NULL
Expand Down Expand Up @@ -234,9 +242,32 @@ CLASS VOControlCreationOrderDlg INHERIT System.Windows.Forms.Form
RETURN

PROTECTED METHOD UseMouseButtonClick(o AS OBJECT , e AS EventArgs) AS VOID
SELF:oEditor:SelectMainItem()
SELF:lUsingMouse := TRUE
SELF:nMouseIndex := 0
LOCAL nSelectedIndex := 0 AS INT
IF SELF:oControlsList:SelectedIndices:Count == 1
nSelectedIndex := SELF:oControlsList:SelectedIndices[0]
IF nSelectedIndex >= SELF:oControlsList:Items:Count - 1
nSelectedIndex := 0
END IF
ENDIF

IF nSelectedIndex > 0 .and. XFuncs.QuestionBox(String.Format("Start adjusting order after the selected control {0} ?" , ((DesignWindowItem)SELF:oControlsList:Items[nSelectedIndex]:Tag):Name), "Set control order" )
SELF:lUsingMouse := TRUE
FOR LOCAL n := 0 AS INT UPTO nSelectedIndex
LOCAL oDesign AS DesignItem
oDesign := SELF:oControlsList:Items[n]:Tag ASTYPE DesignItem
IF n == 0
SELF:oEditor:DoAction(DesignerActionType.Select , oDesign:cGuid)
ELSE
SELF:oEditor:DoAction(DesignerActionType.SelectAdd , oDesign:cGuid)
END IF
NEXT
SELF:nMouseIndex := nSelectedIndex + 1
ELSE
SELF:lUsingMouse := TRUE
SELF:oEditor:SelectMainItem()
SELF:nMouseIndex := 0
END IF

SELF:oTimer:Start()
RETURN
METHOD TimerTicked(o AS OBJECT , e AS EventArgs) AS VOID
Expand Down Expand Up @@ -330,7 +361,7 @@ CLASS VOControlCreationOrderDlg INHERIT System.Windows.Forms.Form
IF lUp .and. nIndex == 0
RETURN
ENDIF
IF !lUp .and. nIndex == SELF:oControlsList:Items:Count - 1
IF .not. lUp .and. nIndex == SELF:oControlsList:Items:Count - 1
RETURN
ENDIF
oItem := SELF:oControlsList:Items[nIndex]
Expand All @@ -344,10 +375,15 @@ CLASS VOControlCreationOrderDlg INHERIT System.Windows.Forms.Form
RETURN

PROTECTED METHOD OKButtonClick(o AS OBJECT , e AS System.EventArgs) AS VOID
LOCAL oDesign AS DesignItem
LOCAL n AS INT
SELF:aNewOrder := List<DesignWindowItem>{}
FOREACH oItem AS ListViewItem IN SELF:oControlsList:Items
SELF:aNewOrder:Add(oItem:Tag ASTYPE DesignWindowItem)
NEXT
IF SELF:oControlsList:SelectedIndices:Count == 1
SELF:cLastSelectedGuid := ((DesignItem)SELF:oControlsList:SelectedItems[0]:Tag):cGuid
END IF
SELF:DialogResult := DialogResult.OK
RETURN

Expand Down
4 changes: 2 additions & 2 deletions src/VisualStudio/XSharpVoEditors/Designers/Controls.prg
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ INTERNAL CLASS DesignCheckBox INHERIT CheckBox
override protected method OnPaint(e as PaintEventArgs) as void
super:OnPaint(e)

if self:lTestMode
/* if self:lTestMode
// SELF:Text := ""
return
end if
end if*/

if self:oBrush == null .or. self:oBrush:Color != self:ForeColor
self:oBrush := SolidBrush{self:ForeColor}
Expand Down
2 changes: 1 addition & 1 deletion src/VisualStudio/XSharpVoEditors/Designers/PropGrid.prg
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ CLASS DesignerGrid INHERIT Panel
RETURN
END IF

oDesign := (DesignItem)SELF:aSelected[0]
oDesign := (DesignItem)SELF:aSelected[SELF:aSelected:Count - 1] // Show the props from the last selected item

SELF:SetPages(oDesign:aPages)

Expand Down
19 changes: 16 additions & 3 deletions src/VisualStudio/XSharpVoEditors/Designers/VOWindowEditor.prg
Original file line number Diff line number Diff line change
Expand Up @@ -1659,8 +1659,15 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase
IF SELF:lReadOnly
RETURN
ENDIF
SELF:SelectMainItem()
oDlg := VOControlCreationOrderDlg{SELF , SELF:GetAllDesignItemsByCreationOrder()}

LOCAL oSelected AS DesignWindowItem
IF self:aSelected:Count == 1
oSelected := (DesignWindowItem)aSelected[0]
ELSE
oSelected := NULL
END IF

oDlg := VOControlCreationOrderDlg{SELF , SELF:GetAllDesignItemsByCreationOrder(), oSelected}
IF oDlg:ShowDialog() == DialogResult.OK
SELF:BeginAction()
FOR n := 0 UPTO oDlg:aNewOrder:Count - 1
Expand All @@ -1670,6 +1677,9 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase
SELF:EndAction()
ENDIF
SELF:SelectMainItem()
IF .not. String.IsNullOrEmpty( oDlg:LastSelectedGuid )
SELF:DoAction(DesignerActionType.Select , oDlg:LastSelectedGuid)
END IF
RETURN

METHOD DoDummyChange() AS VOID
Expand Down Expand Up @@ -3515,7 +3525,7 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase
LOCAL oEntry AS DesignerClipboardEntry
LOCAL lNameConflict AS LOGIC
LOCAL cGuid AS STRING
LOCAL n,m AS INT
LOCAL n,m,nNewOrder AS INT

IF SELF:lReadOnly
RETURN
Expand All @@ -3528,12 +3538,14 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase
RETURN
END IF

nNewOrder := GetAllDesignItems():Count
SELF:BeginAction()
SELF:DoAction(DesignerActionType.DeSelectAll)
FOR n := 0 UPTO Clipboard:Count - 1
oEntry := Clipboard:GetEntry(n)
lNameConflict := SELF:NameExists(oEntry:cName)
oEntry:nPasted ++
nNewOrder ++
cGuid := Guid.NewGuid():ToString()
SELF:StartAction(DesignerBasicActionType.Create , ActionData{cGuid , oEntry:cClass , ""})
FOR m := 0 UPTO oEntry:aProperties:Count - 1
Expand All @@ -3544,6 +3556,7 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase
END IF
SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{cGuid , "_Left" , oEntry:x + XCustomEditorSettings.PasteOffSetX * oEntry:nPasted})
SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{cGuid , "_Top" , oEntry:y + XCustomEditorSettings.PasteOffSetY * oEntry:nPasted})
SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{cGuid , "__Order" , nNewOrder})
IF SELF:ViewMode == ViewMode.Browse
SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{cGuid , "_Deleted" , 1})
END IF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@
// <auto-generated>
// This code was generated by a tool.
// Runtime version: 4.0.30319.42000
// Generator : XSharp.CodeDomProvider 2.20.0.3
// Timestamp : 05/07/2024 13:12:43
// Generator : XSharp.CodeDomProvider 2.21.0.4
// Timestamp : 05/11/2024 17:42:13
//
// Changes to this file may cause incorrect behavior and may be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

BEGIN NAMESPACE XSharp.VOEditors.Dialogs

PUBLIC PARTIAL CLASS WindowCloneSelectDlg

/// <summary>
/// Required designer variable.
/// </summary>

PRIVATE components := NULL AS System.ComponentModel.IContainer
PRIVATE oCancelButton AS System.Windows.Forms.Button
PRIVATE oOKButton AS System.Windows.Forms.Button
PRIVATE oFilesList AS System.Windows.Forms.ListBox
PRIVATE SelectFolder AS System.Windows.Forms.Button
PRIVATE SearchButton AS System.Windows.Forms.Button
PRIVATE oSearchTextbox AS System.Windows.Forms.TextBox

/// <summary>
/// Clean up any resources being used.
Expand All @@ -39,46 +44,88 @@ BEGIN NAMESPACE XSharp.VOEditors.Dialogs
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
PRIVATE METHOD InitializeComponent() AS VOID STRICT

PRIVATE METHOD InitializeComponent() AS VOID STRICT
SELF:oCancelButton := System.Windows.Forms.Button{}
SELF:oOKButton := System.Windows.Forms.Button{}
SELF:oFilesList := System.Windows.Forms.ListBox{}
SELF:oSearchTextbox := System.Windows.Forms.TextBox{}
SELF:SelectFolder := System.Windows.Forms.Button{}
SELF:SearchButton := System.Windows.Forms.Button{}
SELF:SuspendLayout()
//
// oCancelButton
//
SELF:oCancelButton:Anchor := System.Windows.Forms.AnchorStyles.Right
SELF:oCancelButton:Anchor := ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)))
SELF:oCancelButton:DialogResult := System.Windows.Forms.DialogResult.Cancel
SELF:oCancelButton:Location := System.Drawing.Point{346, 353}
SELF:oCancelButton:Location := System.Drawing.Point{332, 348}
SELF:oCancelButton:Name := "oCancelButton"
SELF:oCancelButton:Size := System.Drawing.Size{115, 23}
SELF:oCancelButton:TabIndex := 2
SELF:oCancelButton:TabIndex := 5
SELF:oCancelButton:Text := "&Cancel"
//
// oOKButton
//
SELF:oOKButton:Anchor := System.Windows.Forms.AnchorStyles.Left
SELF:oOKButton:Location := System.Drawing.Point{12, 353}
SELF:oOKButton:Anchor := ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)))
SELF:oOKButton:Location := System.Drawing.Point{12, 348}
SELF:oOKButton:Name := "oOKButton"
SELF:oOKButton:Size := System.Drawing.Size{115, 23}
SELF:oOKButton:TabIndex := 1
SELF:oOKButton:TabIndex := 3
SELF:oOKButton:Text := "&OK"
SELF:oOKButton:Click += System.EventHandler{ SELF, @oOKButton_Click() }
//
// oFilesList
//
SELF:oFilesList:Anchor := System.Windows.Forms.AnchorStyles.Top
SELF:oFilesList:Anchor := ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) ;
| System.Windows.Forms.AnchorStyles.Left) ;
| System.Windows.Forms.AnchorStyles.Right)))
SELF:oFilesList:IntegralHeight := false
SELF:oFilesList:ItemHeight := 24
SELF:oFilesList:Location := System.Drawing.Point{12, 10}
SELF:oFilesList:Name := "oFilesList"
SELF:oFilesList:Size := System.Drawing.Size{449, 329}
SELF:oFilesList:Size := System.Drawing.Size{435, 290}
SELF:oFilesList:TabIndex := 0
SELF:oFilesList:DoubleClick += System.EventHandler{ SELF, @oOKButton_Click() }
//
// oSearchTextbox
//
SELF:oSearchTextbox:Anchor := ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) ;
| System.Windows.Forms.AnchorStyles.Right)))
SELF:oSearchTextbox:Location := System.Drawing.Point{12, 306}
SELF:oSearchTextbox:Name := "oSearchTextbox"
SELF:oSearchTextbox:Size := System.Drawing.Size{314, 29}
SELF:oSearchTextbox:TabIndex := 1
//
// SelectFolder
//
SELF:SelectFolder:Anchor := ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)))
SELF:SelectFolder:Location := System.Drawing.Point{179, 348}
SELF:SelectFolder:Name := "SelectFolder"
SELF:SelectFolder:Size := System.Drawing.Size{115, 23}
SELF:SelectFolder:TabIndex := 4
SELF:SelectFolder:Text := "Select &Folder"
SELF:SelectFolder:UseVisualStyleBackColor := true
SELF:SelectFolder:Click += System.EventHandler{ SELF, @SelectFolder_Click() }
//
// SearchButton
//
SELF:SearchButton:Anchor := ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)))
SELF:SearchButton:Location := System.Drawing.Point{334, 304}
SELF:SearchButton:Name := "SearchButton"
SELF:SearchButton:Size := System.Drawing.Size{113, 23}
SELF:SearchButton:TabIndex := 2
SELF:SearchButton:Text := "&Search"
SELF:SearchButton:UseVisualStyleBackColor := true
SELF:SearchButton:Click += System.EventHandler{ SELF, @SearchButton_Click() }
//
// WindowCloneSelectDlg
//
SELF:AcceptButton := SELF:oOKButton
SELF:CancelButton := SELF:oCancelButton
SELF:ClientSize := System.Drawing.Size{473, 385}
SELF:ClientSize := System.Drawing.Size{459, 386}
SELF:Controls:Add(SELF:SearchButton)
SELF:Controls:Add(SELF:SelectFolder)
SELF:Controls:Add(SELF:oSearchTextbox)
SELF:Controls:Add(SELF:oCancelButton)
SELF:Controls:Add(SELF:oOKButton)
SELF:Controls:Add(SELF:oFilesList)
Expand All @@ -89,7 +136,9 @@ BEGIN NAMESPACE XSharp.VOEditors.Dialogs
SELF:StartPosition := System.Windows.Forms.FormStartPosition.Manual
SELF:Text := "Choose source window to duplicate:"
SELF:ResumeLayout(false)
SELF:PerformLayout()
END METHOD

#endregion
END CLASS
END NAMESPACE
Loading
Loading