' Copyright (C) 2025  P4pillon.org
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero General Public License as
' published by the Free Software Foundation, either version 3 of the
' License, or (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU Affero General Public License for more details.
'
' You should have received a copy of the GNU Affero General Public License
' along with this program.  If not, see <https://www.gnu.org/licenses/>.
Public Class MENU_PRINCIPAL_Right_Click
    'Public MENU_PRINCIPAL_current_panel As Panel
    Public Source_Panel As Panel
    Public image As Image




    Private Sub MENU_PRINCIPAL_Right_Click_Load(sender As Object, e As EventArgs) Handles Me.Load
        Button1.BackgroundImage = image
        populate()
    End Sub

    Private Sub populate()
        FlowLayoutPanel1.Controls.Clear()
        For Each But As Button In Source_Panel.Controls
            If But.GetType Is GetType(System.Windows.Forms.Button) Then
                Dim New_But As New Button
                New_But.Tag = But
                New_But.Text = But.Text
                New_But.Size = New Size(386, 30)
                New_But.Font = New Font("Century Gothic", 12)

                AddHandler New_But.Click, AddressOf New_But_Click
                If But.Tag <> "Picture" And But.Text <> "" Then
                    FlowLayoutPanel1.Controls.Add(New_But)
                End If
            End If
        Next
    End Sub
    Private Sub New_But_Click(ByVal sender As Button, ByVal e As System.EventArgs)
        'MENU_PRINCIPAL_current_panel.Visible = False
        MENU_PRINCIPAL.MENU_PRINCIPAL_Panel.Visible = False
        Source_Panel.Visible = True
        sender.Tag.PerformClick()
        Source_Panel.Visible = False
        'MENU_PRINCIPAL_current_panel.Visible = True
        MENU_PRINCIPAL.MENU_PRINCIPAL_Panel.Visible = True
    End Sub
End Class