Todabía no la tengo termianda pero dejo lo que ya tengo. Hasta el momento solo muestra ventanas...
Importante: Para el funcionamiento del código es necesario el truevision 3d, puede ser descargado de: TV3D
En un Form1:
En un módulo de clase "siGUI"Código:Option Explicit Private TV& ;nbs p; As TVEngine Private Scr&am p;nb sp; As TVScreen2DImmediate Private ScrText  ; ; As TVScreen2DText Private WithEvents Inp As TVInputEngine Private Running  ; ; As Boolean Private tst&am p;nb sp; As siGUI Private Sub Form_Load() Set TV = New TVEngine Set Scr = New TVScreen2DImmediate Set ScrText = New TVScreen2DText Set Inp = New TVInputEngine Set tst = New siGUI Me.Show TV.Init3DWindowedMode Me.hWnd TV.DisplayFPS = True Inp.EnableEvents True With tst Set .Scr = Scr Set .ScrText = ScrText Set .Inp = Inp End With Running = True Do DoEvents TV.Clear Scr.ACTION_Begin2D tst.RenderizarTodo Scr.ACTION_End2D If Inp.IsKeyPressed(TV_KEY_S) Then Randomize tst.AddWindow Rnd * 200, Rnd * 200, 100, 100, Rnd * 100, RGBA(Rnd, Rnd, Rnd, 0.99), RGBA(Rnd, Rnd, Rnd, 1) End If TV.RenderToScreen Loop While Running Set TV = Nothing Set Scr = Nothing Set ScrText = Nothing Set Inp = Nothing Set tst = Nothing Unload Me End Sub Private Sub Form_QueryUnload(Cancel As Integer, _ UnloadMode As Integer) If Running Then Running = False Cancel = 1 End If End Sub Private Sub Form_Resize() TV.ResizeDevice Inp.EnableEvents True Set tst.Inp = Inp End Sub
Y en otro m de clase "siWindow"Código:Option Explicit 'local variable(s) to hold property value(s) Private mvarWindows& amp; nbsp; As Collection 'local copy Private mvar Scr&am p;nb sp; As TVScreen2DImmediate 'local copy Private mvar ScrText  ; ; As TVScreen2DText 'local copy Private WithEvents mvarInp As TVInputEngine 'local copy Private Dragging As Boolean 'Arrastrando? Private DrgWin As Integer 'a quién? Private Order() As Integer 'mantiene el orden de las ventanas Public Function AddWindow(ByVal x As Long, _ ByVal Y As Long, _ ByVal Alto As Long, _ ByVal Ancho As Long, _ ByVal strCaption As String, _ Optional ByVal lngBackColor As Long, _ Optional ByVal BorderColor As Long, _ Optional ByVal Nombre As String) As Object Dim newObj As siWindow Set newObj = New siWindow With newObj 'asigno todas las propiedades .PosX = x .PosY = Y .Alto = Alto .Ancho = Ancho .Caption = strCaption .BackColor = lngBackColor .BorderColor = BorderColor Set .Scr = mvarScr Set .ScrText = mvarScrText End With If Len(Nombre) = 0 Then mvarWindows.Add newObj Else mvarWindows.Add newObj, Nombre End If Set newObj = Nothing ReDim Preserve Order(1 To Windows.Count) Order(Windows.Count) = Windows.Count End Function Private Sub Class_Initialize() Set mvarWindows = New Collection End Sub Private Sub Class_Terminate() Set mvarWindows = Nothing End Sub Public Property Get Inp() As TVInputEngine 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.Inp Set Inp = mvarInp End Property Public Property Set Inp(ByVal vData As TVInputEngine) 'used when assigning an Object to the property, on the left side of a Set statement. 'Syntax: Set x.Inp = Form1 Set mvarInp = vData End Property Private Sub mvarInp_MouseChanged(ByVal x As Long, _ ByVal Y As Long, _ ByVal Z As Long, _ ByVal Button1 As Boolean, _ ByVal Button2 As Boolean, _ ByVal Button3 As Boolean, _ ByVal Button4 As Boolean) Dim i As Integer Dim ax As Long Dim ay As Long '<:-) :UPDATED: Multiple Dim line separated '<:-) :PREVIOUS CODE : Dim ax As Long, ay As Long Dim j As Integer Dim oldOrder() As Integer If Windows.Count > 0 Then 'si hay ventanas Inp.GetAbsMouseState ax, ay 'obtengo las direcciones absolutas del mouse For i = 1 To Windows.Count 'recorro ventanas If Not Dragging Then 'si no se está arrastrando With Windows(Order(i)) If ax > .PosX And ax < .PosX + .Ancho And ay > .PosY And ay < .PosY + 15 And Button1 Then 'si le hago click .PosX = ax - .Ancho / 2 .PosY = ay - 15 / 2 Dragging = True DrgWin = Order(i) If Not (i = 1) Then oldOrder = Order Order(1) = Order(i) For j = 2 To UBound(Order) Order(j) = oldOrder(j - 1) If oldOrder(j) = Order(1) Then Exit For End If '<:-) Structure Expanded. Next j End If End If End With Else Windows(DrgWin).PosX = ax - Windows(DrgWin).Ancho / 2 Windows(DrgWin).PosY = ay - 15 / 2 Exit For End If Next i If Dragging And Not Button1 Then Windows(DrgWin).Focused = False Dragging = False End If End If End Sub Public Sub RenderizarTodo() Dim i As Integer If Windows.Count > 0 Then 'Dim focwin As Integer For i = Windows.Count To 1 Step -1 'If Not Windows(Order(i)).Focused Then Windows(Order(i)).Renderizar 'Else: focwin = i 'End If Next i 'If focwin > 0 Then Windows(focwin).Renderizar End If End Sub Public Property Get Scr() As TVScreen2DImmediate 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.Scr Set Scr = mvarScr End Property Public Property Set Scr(ByVal vData As TVScreen2DImmediate) 'used when assigning an Object to the property, on the left side of a Set statement. 'Syntax: Set x.Scr = Form1 Set mvarScr = vData End Property Public Property Get ScrText() As TVScreen2DText 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.ScrText Set ScrText = mvarScrText End Property Public Property Set ScrText(ByVal vData As TVScreen2DText) 'used when assigning an Object to the property, on the left side of a Set statement. 'Syntax: Set x.ScrText = Form1 Set mvarScrText = vData End Property Public Property Get Windows() As Collection 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.Windows Set Windows = mvarWindows End Property Public Property Set Windows(ByVal vData As Collection) 'used when assigning an Object to the property, on the left side of a Set statement. 'Syntax: Set x.Windows = Form1 Set mvarWindows = vData End Property
Saludos y espero tener más pronto...Código:Option Explicit 'local variable(s) to hold property value(s) Private mvarPosX& ;nbs p; As Long 'local copy Private mvarPosY& ;nbs p; As Long 'local copy Private mvarAncho As Long 'local copy Private mvarAlto& ;nbs p; As Long 'local copy Private mvarFocused As Boolean  ; ; 'local copy Private mvarBackColor As Long 'local copy Private mvarBorderColor As Long 'local copy 'local variable(s) to hold property value(s) Private mvarCaption As String 'local copy 'local variable(s) to hold property value(s) Private mvarScr  ; ; As TVScreen2DImmediate 'local copy Private mvarScrText As TVScreen2DText 'local copy Public Property Get Alto() As Long 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.Alto Alto = mvarAlto End Property Public Property Let Alto(ByVal vData As Long) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.Alto = 5 mvarAlto = vData End Property Public Property Get Ancho() As Long 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.Ancho Ancho = mvarAncho End Property Public Property Let Ancho(ByVal vData As Long) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.Ancho = 5 mvarAncho = vData End Property Public Property Get BackColor() As Long 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.BackColor BackColor = mvarBackColor End Property Public Property Let BackColor(ByVal vData As Long) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.BackColor = 5 mvarBackColor = vData End Property Public Property Get BorderColor() As Long 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.BorderColor BorderColor = mvarBorderColor End Property Public Property Let BorderColor(ByVal vData As Long) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.BorderColor = 5 mvarBorderColor = vData End Property Public Property Get Caption() As String 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.Caption Caption = mvarCaption End Property Public Property Let Caption(ByVal vData As String) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.Caption = 5 mvarCaption = vData End Property Public Property Get Focused() As Boolean 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.Focused Focused = mvarFocused End Property Public Property Let Focused(ByVal vData As Boolean) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.Focused = 5 mvarFocused = vData End Property Public Property Get PosX() As Long 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.PosX PosX = mvarPosX End Property Public Property Let PosX(ByVal vData As Long) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.PosX = 5 mvarPosX = vData End Property Public Property Get PosY() As Long 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.PosY PosY = mvarPosY End Property Public Property Let PosY(ByVal vData As Long) 'used when assigning a value to the property, on the left side of an assignment. 'Syntax: X.PosY = 5 mvarPosY = vData End Property Public Sub Renderizar() With mvarScr .DRAW_FilledBox mvarPosX, mvarPosY, mvarPosX + mvarAncho, mvarPosY + mvarAlto, IIf(mvarBackColor = 0, RGBA(1, 1, 1, 0.75), mvarBackColor) .DRAW_Box mvarPosX, mvarPosY, mvarPosX + mvarAncho, mvarPosY + mvarAlto, IIf(mvarBorderColor = 0, -1, mvarBorderColor) .DRAW_Box mvarPosX + 2, mvarPosY + 2, mvarPosX + mvarAncho - 2, mvarPosY + mvarAlto - 2, IIf(mvarBorderColor = 0, -1, mvarBorderColor) .DRAW_Line mvarPosX + 2, mvarPosY + 15, mvarPosX + mvarAncho - 2, mvarPosY + 15, IIf(mvarBorderColor = 0, -1, mvarBorderColor) End With 'Scr mvarScrText.TextureFont_DrawText mvarCaption, mvarPosX + 4, mvarPosY + 2, -1 End Sub Public Property Get Scr() As TVScreen2DImmediate 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.Scr Set Scr = mvarScr End Property Public Property Set Scr(ByVal vData As TVScreen2DImmediate) 'used when assigning an Object to the property, on the left side of a Set statement. 'Syntax: Set x.Scr = Form1 Set mvarScr = vData End Property Public Property Get ScrText() As TVScreen2DText 'used when retrieving value of a property, on the right side of an assignment. 'Syntax: Debug.Print X.ScrText Set ScrText = mvarScrText End Property Public Property Set ScrText(ByVal vData As TVScreen2DText) 'used when assigning an Object to the property, on the left side of a Set statement. 'Syntax: Set x.ScrText = Form1 Set mvarScrText = vData End Property
Edited by: Post-Newbie

LinkBack URL
About LinkBacks
Citar