DashboardLayout
TsgcHTMLDashboardLayout — 渲染完整的仪表板外壳,带有固定侧边栏和带标题的内容区,适用于 Delphi、C++ Builder 和 .NET。
TsgcHTMLDashboardLayout — 渲染完整的仪表板外壳,带有固定侧边栏和带标题的内容区,适用于 Delphi、C++ Builder 和 .NET。
一个布局组件,发出完整的仪表板外壳:左侧的固定侧边栏和由带标题区块构建的带内边距主区域。配置 Sidebar,添加内容区,然后读取 HTML 属性。
配置只读的 Sidebar,为每个区块调用 AddSection(title, content),然后读取 HTML(或将其放入 TsgcHTMLTemplate_Bootstrap 页面)。
uses
sgcHTML_Enums, sgcHTML_Component_DashboardLayout;
var
oDash: TsgcHTMLDashboardLayout;
begin
oDash := TsgcHTMLDashboardLayout.Create(nil);
try
oDash.DarkMode := True;
oDash.FooterText := '© 2026 Acme Inc.';
oDash.Sidebar.Brand := 'Acme Admin';
oDash.Sidebar.Items.Add.Text := 'Overview';
oDash.Sidebar.Items.Add.Text := 'Reports';
oDash.AddSection('Sales', '<p>Revenue is up 12%</p>');
oDash.AddSection('Activity', '<p>3 new orders</p>');
WebModule.Response := oDash.HTML; // dashboard shell
finally
oDash.Free;
end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_DashboardLayout.hpp
TsgcHTMLDashboardLayout *oDash = new TsgcHTMLDashboardLayout(NULL);
try
{
oDash->DarkMode = true;
oDash->FooterText = "© 2026 Acme Inc.";
oDash->Sidebar->Brand = "Acme Admin";
oDash->Sidebar->Items->Add()->Text = "Overview";
oDash->Sidebar->Items->Add()->Text = "Reports";
oDash->AddSection("Sales", "<p>Revenue is up 12%</p>");
oDash->AddSection("Activity", "<p>3 new orders</p>");
String html = oDash->HTML; // dashboard shell
}
__finally
{
delete oDash;
}
using esegece.sgcWebSockets;
var dash = new TsgcHTMLDashboardLayout();
dash.DarkMode = true;
dash.FooterText = "© 2026 Acme Inc.";
dash.Sidebar.Brand = "Acme Admin";
dash.Sidebar.Items.Add().Text = "Overview";
dash.Sidebar.Items.Add().Text = "Reports";
dash.AddSection("Sales", "<p>Revenue is up 12%</p>");
dash.AddSection("Activity", "<p>3 new orders</p>");
string html = dash.HTML; // dashboard shell
您最常使用的成员。
Sidebar 是一个只读的 TsgcHTMLComponent_Sidebar,固定渲染在左侧;就地配置其 Brand、Width 和 Items。
AddSection(aTitle, aContent, aID) 追加一个带标题的 <section>;AddRawContent(aContent) 原样放入标记;ClearContent 清空主区域。
Fluid 切换全宽容器,FooterText 添加居中页脚,LayoutID 设置包装器的元素 id。
DarkMode 注入暗黑主题样式表,为外壳内的卡片、表格、表单、导航和列表组重新着色。
MainPadding、MainMinHeight 和 SectionMarginBottom 设置主区域的尺寸;SectionTitleBorderColorStyle(一个 TsgcHTMLColor)为每个内容区的标题下划线着色。
HTML 返回完整外壳 — 固定侧边栏、主内容和页脚 — 可直接提供服务,或将其赋给页面模板的 BodyContent。