From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
"TclMenuFrame" is a component frame type in Clomosy. This frame can be used as a menu component and helps create menu options in the application.
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
function AddNewMenuFrame(AComponent: TCLComponent; xName: string): TclMenuFrame;
</div>


TclMenuFrame usage principles are as follows:
<span style="color:blue"><b>AComponent</b></span> :  The variable name of the defined component is written. Here you have to write the name of the component you want in it.<br>


<span style="color:blue"><b>xName</b></span> : The name of the defined component should be written.<br>
"TclMenuFrame" is a component frame type in Clomosy. This frame can be used as a menu component and helps create menu options in the application.<br>
<div class="table-responsive">
{| class="wikitable" style="border: 2px solid #c3d7e0"
{| class="wikitable" style="border: 2px solid #c3d7e0"
! style="background-color: #c3d7e0"| Feature !!style="background-color: #c3d7e0"| Use of !!style="background-color: #c3d7e0"|Definition  
! style="background-color: #c3d7e0"| Feature !!style="background-color: #c3d7e0"| Use of !!style="background-color: #c3d7e0"| Definition  
|-
|-
|TClMenuFrame || TstSideMenu : TClMenuFrame; || A variable belonging to the TclMenuFrame class is created.
|TClMenuFrame || MenuFrame1 : TClMenuFrame; || A variable belonging to the TclMenuFrame class is created.
|-
|-
|AddNewMenuFrame ||TstSideMenu := MyForm.AddNewMenuFrame(MyForm,'TstSideMenu'); ||A new Menu Frame is added to the form.
|AddNewMenuFrame ||MenuFrame1 = Form1.AddNewMenuFrame(Form1,'MenuFrame1'); ||A new Menu Frame is added to the form.
|-
|-
|Align ||TstSideMenu.Align := alContents; ||Alignment adjustment is made.
|Align ||MenuFrame1.Align = alContents; ||Alignment adjustment is made.
|-
|-
|MenuBar ||TstSideMenu.MenuBar.Width := 250; TstSideMenu.MenuBar.Height := 250; || It defines the main menu of the application and provides users with access to application functions. With this, adjustments such as height and width can be made.
|MenuBar ||MenuFrame1.MenuBar.Width = 250; MenuFrame1.MenuBar.Height = 250; || It defines the main menu of the application and provides users with access to application functions. With this, adjustments such as height and width can be made.
|-
|-
|Visible ||TstSideMenu.Visible := False; ||Visibility settings can be adjusted. If it is true it is visible, if it is false it is not visible.
|Visible ||MenuFrame1.Visible = False; ||Visibility settings can be adjusted. If it is true it is visible, if it is false it is not visible.
|-
|-
|ClMenuPosition ||TstSideMenu.ClMenuPosition := clLeft;||Menu Frame position is set.(Default => clRight)
|ClMenuPosition ||MenuFrame1.ClMenuPosition = clLeft;||Menu Frame position is set.(Default => clRight)
|-
|-
|VertScrollBox ||TstSideMenu.VertScrollBox || The MenuFrame provides an area with a vertical scrollbar within. This allows objects placed inside it to be created and displayed vertically one below the other.
|VertScrollBox ||MenuFrame1.VertScrollBox || The MenuFrame provides an area with a vertical scrollbar within. This allows objects placed inside it to be created and displayed vertically one below the other.
|}
|}
</div>
<b>Example</b><br>
<pre>
Var
MyForm : TclForm;
TstSideMenu : TClMenuFrame;
ShowBtn,menuBtn: TClProButton;
void showMenuFrame;
{
TstSideMenu.Visible = True;
clRTMethod(TstSideMenu, 'BringTofront');
}
void showShowBtn;
{
TstSideMenu.Visible = False;
clRTMethod(menuBtn, 'BringTofront');
}
{
MyForm = TclForm.Create(Self);
TstSideMenu = MyForm.AddNewMenuFrame(MyForm,'TstSideMenu');
TstSideMenu.Align = alContents;
TstSideMenu.MenuBar.Width = 250;
TstSideMenu.Visible = False;
TstSideMenu.ClMenuPosition = clLeft;  //Default clRight
menuBtn= MyForm.AddNewProButton(MyForm,'menuBtn','...');
clComponent.SetupComponent(menuBtn,'{"Align":"Left",
"BackgroundColor":"#7295ed", "TextColor":"#ffffff",
"TextBold":"yes","RoundHeight":10,"RoundWidth":10}');
MyForm.AddNewEvent(menuBtn,tbeOnClick,'showMenuFrame');


'''Example:'''
ShowBtn= MyForm.AddNewProButton(TstSideMenu.VertScrollBox,'ShowBtn','Show');
clComponent.SetupComponent(ShowBtn,'{"Height":40,"MarginTop":10,"Align":"Top","TextHorizontalAlign":"center","BackgroundColor":"#fc6713", "TextColor":"#ffffff","TextBold":"yes","RoundHeight":10,"RoundWidth":10}');
MyForm.AddNewEvent(ShowBtn,tbeOnClick,'showShowBtn');


:'''TRObject Syntax'''
MyForm.Run;   
Var
}
MyForm : TclForm;
</pre>
TstSideMenu : TClMenuFrame;
ShowBtn,menuBtn: TClProButton;
void showMenuFrame;
{
TstSideMenu.Visible = True;
clRTMethod(TstSideMenu, 'BringTofront');
}
void showShowBtn;
{
TstSideMenu.Visible = False;
  clRTMethod(menuBtn, 'BringTofront');
}
{
MyForm = TclForm.Create(Self);
TstSideMenu = MyForm.AddNewMenuFrame(MyForm,'TstSideMenu');
TstSideMenu.Align = alContents;
TstSideMenu.MenuBar.Width = 250;
TstSideMenu.Visible = False;
TstSideMenu.ClMenuPosition = clLeft;  //Default clRight
menuBtn= MyForm.AddNewProButton(MyForm,'menuBtn','...');
clComponent.SetupComponent(menuBtn,'{"Align":"Left",
"BackgroundColor":"#7295ed", "TextColor":"#ffffff",
"TextBold":"yes","RoundHeight":10,"RoundWidth":10}');
MyForm.AddNewEvent(menuBtn,tbeOnClick,'showMenuFrame');
ShowBtn= MyForm.AddNewProButton(TstSideMenu.VertScrollBox,'ShowBtn','Show');
clComponent.SetupComponent(ShowBtn,'{"Height":40,"MarginTop":10,"Align":"Top","TextHorizontalAlign":"center","BackgroundColor":"#fc6713", "TextColor":"#ffffff","TextBold":"yes","RoundHeight":10,"RoundWidth":10}');
MyForm.AddNewEvent(ShowBtn,tbeOnClick,'showShowBtn');
MyForm.Run; 
}


:'''Base Syntax'''
<h2> See Also </h2>
Var
* [[Components]]
  MyForm : TclForm;
* [[Object Properties]]
  TstSideMenu : TClMenuFrame;
* [[AddNewEvent]]
  ShowBtn,menuBtn: TClProButton;
procedure showMenuFrame;
begin
  TstSideMenu.Visible := True;
  clRTMethod(TstSideMenu, 'BringTofront');
end;
procedure showShowBtn;
begin
  TstSideMenu.Visible := False;
  clRTMethod(menuBtn, 'BringTofront');
end;
Begin
  MyForm := TclForm.Create(Self);
  TstSideMenu := MyForm.AddNewMenuFrame(MyForm,'TstSideMenu');
  TstSideMenu.Align := alContents;
  TstSideMenu.MenuBar.Width := 250;
  TstSideMenu.Visible := False;
  TstSideMenu.ClMenuPosition := clLeft;  //Default clRight
  menuBtn:= MyForm.AddNewProButton(MyForm,'menuBtn','...');
  clComponent.SetupComponent(menuBtn,'{"Align":"Left",
  "BackgroundColor":"#7295ed", "TextColor":"#ffffff",
  "TextBold":"yes","RoundHeight":10,"RoundWidth":10}');
  MyForm.AddNewEvent(menuBtn,tbeOnClick,'showMenuFrame');
  ShowBtn:= MyForm.AddNewProButton(TstSideMenu.VertScrollBox,'ShowBtn','Show');
clComponent.SetupComponent(ShowBtn,'{"Height":40,"MarginTop":10,"Align":"Top","TextHorizontalAlign":"center","BackgroundColor":"#fc6713", "TextColor":"#ffffff","TextBold":"yes","RoundHeight":10,"RoundWidth":10}');
  MyForm.AddNewEvent(ShowBtn,tbeOnClick,'showShowBtn');
  MyForm.Run; 
End;

Revision as of 12:55, 7 November 2024

AComponent : The variable name of the defined component is written. Here you have to write the name of the component you want in it.

xName : The name of the defined component should be written.

"TclMenuFrame" is a component frame type in Clomosy. This frame can be used as a menu component and helps create menu options in the application.

Feature Use of Definition
TClMenuFrame MenuFrame1 : TClMenuFrame; A variable belonging to the TclMenuFrame class is created.
AddNewMenuFrame MenuFrame1 = Form1.AddNewMenuFrame(Form1,'MenuFrame1'); A new Menu Frame is added to the form.
Align MenuFrame1.Align = alContents; Alignment adjustment is made.
MenuBar MenuFrame1.MenuBar.Width = 250; MenuFrame1.MenuBar.Height = 250; It defines the main menu of the application and provides users with access to application functions. With this, adjustments such as height and width can be made.
Visible MenuFrame1.Visible = False; Visibility settings can be adjusted. If it is true it is visible, if it is false it is not visible.
ClMenuPosition MenuFrame1.ClMenuPosition = clLeft; Menu Frame position is set.(Default => clRight)
VertScrollBox MenuFrame1.VertScrollBox The MenuFrame provides an area with a vertical scrollbar within. This allows objects placed inside it to be created and displayed vertically one below the other.

Example

Var
MyForm : TclForm;
TstSideMenu : TClMenuFrame;
ShowBtn,menuBtn: TClProButton;

void showMenuFrame;
{
TstSideMenu.Visible = True;
clRTMethod(TstSideMenu, 'BringTofront');
}

void showShowBtn;
{
TstSideMenu.Visible = False;
clRTMethod(menuBtn, 'BringTofront');
}

{
MyForm = TclForm.Create(Self);
TstSideMenu = MyForm.AddNewMenuFrame(MyForm,'TstSideMenu');
TstSideMenu.Align = alContents;
TstSideMenu.MenuBar.Width = 250;
TstSideMenu.Visible = False;
TstSideMenu.ClMenuPosition = clLeft;   //Default clRight 

menuBtn= MyForm.AddNewProButton(MyForm,'menuBtn','...');
clComponent.SetupComponent(menuBtn,'{"Align":"Left",
"BackgroundColor":"#7295ed", "TextColor":"#ffffff",
"TextBold":"yes","RoundHeight":10,"RoundWidth":10}');
MyForm.AddNewEvent(menuBtn,tbeOnClick,'showMenuFrame');

ShowBtn= MyForm.AddNewProButton(TstSideMenu.VertScrollBox,'ShowBtn','Show');
clComponent.SetupComponent(ShowBtn,'{"Height":40,"MarginTop":10,"Align":"Top","TextHorizontalAlign":"center","BackgroundColor":"#fc6713", "TextColor":"#ffffff","TextBold":"yes","RoundHeight":10,"RoundWidth":10}');
MyForm.AddNewEvent(ShowBtn,tbeOnClick,'showShowBtn');

MyForm.Run;  
}

See Also