本文整理汇总了C#中System.Windows.Forms.InternalWindowManager类的典型用法代码示例。如果您正苦于以下问题:C# InternalWindowManager类的具体用法?C# InternalWindowManager怎么用?C# InternalWindowManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InternalWindowManager类属于System.Windows.Forms命名空间,在下文中一共展示了InternalWindowManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ManagedWindowIconWidth
public abstract int ManagedWindowIconWidth (InternalWindowManager wm);
示例2: ManagedWindowGetMenuButtonSize
public override Size ManagedWindowGetMenuButtonSize (InternalWindowManager wm)
{
Size result = SystemInformation.MenuButtonSize;
result.Width -= 2;
result.Height -= 4;
return result;
}
示例3: ManagedWindowDrawTitleBarAndBorders
protected virtual Rectangle ManagedWindowDrawTitleBarAndBorders (Graphics dc, Rectangle clip, InternalWindowManager wm)
{
Form form = wm.Form;
int tbheight = ManagedWindowTitleBarHeight (wm);
int bdwidth = ManagedWindowBorderWidth (wm);
Color titlebar_color = Color.FromArgb (255, 10, 36, 106);
Color titlebar_color2 = Color.FromArgb (255, 166, 202, 240);
Color color = ThemeEngine.Current.ColorControlDark;
Color color2 = Color.FromArgb (255, 192, 192, 192);
Pen pen = ResPool.GetPen (ColorControl);
Rectangle borders = new Rectangle (0, 0, form.Width, form.Height);
ControlPaint.DrawBorder3D (dc, borders, Border3DStyle.Raised);
// The 3d border is only 2 pixels wide, so we draw the innermost pixels ourselves
borders = new Rectangle (2, 2, form.Width - 5, form.Height - 5);
for (int i = 2; i < bdwidth; i++) {
dc.DrawRectangle (pen, borders);
borders.Inflate (-1, -1);
}
bool draw_titlebar_enabled = false;
if (wm.Form.Parent != null && wm.Form.Parent is Form) {
draw_titlebar_enabled = false;
} else if (wm.IsActive && !wm.IsMaximized) {
draw_titlebar_enabled = true;
}
if (draw_titlebar_enabled) {
color = titlebar_color;
color2 = titlebar_color2;
}
Rectangle tb = new Rectangle (bdwidth, bdwidth, form.Width - (bdwidth * 2), tbheight - 1);
// HACK: For now always draw the titlebar until we get updates better
if (tb.Width > 0 && tb.Height > 0) {
using (System.Drawing.Drawing2D.LinearGradientBrush gradient = new LinearGradientBrush (tb, color, color2, LinearGradientMode.Horizontal))
{
dc.FillRectangle (gradient, tb);
}
}
if (!wm.IsMinimized)
// Draw the line just beneath the title bar
dc.DrawLine (ResPool.GetPen (SystemColors.Control), bdwidth,
tbheight + bdwidth - 1, form.Width - bdwidth - 1,
tbheight + bdwidth - 1);
return tb;
}
示例4: ManagedWindowButtonSize
public override Size ManagedWindowButtonSize (InternalWindowManager wm)
{
int height = ManagedWindowTitleBarHeight (wm);
if (!wm.IsMaximized && !wm.IsMinimized) {
if (wm.IsToolWindow)
return new Size (SystemInformation.ToolWindowCaptionButtonSize.Width - 2,
height - 5);
if (wm.Form.FormBorderStyle == FormBorderStyle.None)
return Size.Empty;
} else
height = SystemInformation.CaptionHeight;
return new Size (SystemInformation.CaptionButtonSize.Width - 2,
height - 5);
}
示例5: ManagedWindowTitleBarHeight
public override int ManagedWindowTitleBarHeight (InternalWindowManager wm)
{
if (wm.IsToolWindow && !wm.IsMinimized)
return SystemInformation.ToolWindowCaptionHeight;
if (wm.Form.FormBorderStyle == FormBorderStyle.None)
return 0;
return SystemInformation.CaptionHeight;
}
示例6: ManagedWindowIconWidth
public override int ManagedWindowIconWidth (InternalWindowManager wm)
{
return ManagedWindowTitleBarHeight (wm) - 5;
}
示例7: ManagedWindowButtonSize
public override Size ManagedWindowButtonSize (InternalWindowManager wm)
{
if (!render_non_client_areas)
return base.ManagedWindowButtonSize (wm);
VisualStyleElement element = wm.IsToolWindow && !wm.IsMinimized ?
VisualStyleElement.Window.SmallCloseButton.Normal :
VisualStyleElement.Window.CloseButton.Normal;
if (!VisualStyleRenderer.IsElementDefined (element))
return base.ManagedWindowButtonSize (wm);
IDeviceContext dc = GetMeasurementDeviceContext ();
Size result = new VisualStyleRenderer (element).GetPartSize (dc, ThemeSizeType.True);
ReleaseMeasurementDeviceContext (dc);
return result;
}
示例8: ManagedWindowDrawMenuButton
public override void ManagedWindowDrawMenuButton (Graphics dc, TitleButton button, Rectangle clip, InternalWindowManager wm)
{
if (!render_non_client_areas) {
base.ManagedWindowDrawMenuButton (dc, button, clip, wm);
return;
}
VisualStyleElement element = ManagedWindowGetMenuButtonVisualStyleElement (button, wm);
if (!VisualStyleRenderer.IsElementDefined (element)) {
base.ManagedWindowDrawMenuButton (dc, button, clip, wm);
return;
}
new VisualStyleRenderer (element).DrawBackground (dc, button.Rectangle, clip);
}
示例9: ManagedWindowDrawMenuButton
public abstract void ManagedWindowDrawMenuButton (Graphics dc, TitleButton button, Rectangle clip, InternalWindowManager wm);
示例10: DrawManagedWindowDecorations
public abstract void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm);
示例11: ManagedWindowGetMenuButtonSize
public abstract Size ManagedWindowGetMenuButtonSize (InternalWindowManager wm);
示例12: ManagedWindowGetTitleBarIconArea
public abstract Rectangle ManagedWindowGetTitleBarIconArea (InternalWindowManager wm);
示例13: ManagedWindowSetButtonLocations
public abstract void ManagedWindowSetButtonLocations (InternalWindowManager wm);
示例14: ManagedWindowGetBorderVisualStyleElements
static void ManagedWindowGetBorderVisualStyleElements (InternalWindowManager wm, out VisualStyleElement left, out VisualStyleElement right, out VisualStyleElement bottom)
{
bool active = !ManagedWindowIsDisabled (wm) && ManagedWindowIsActive (wm);
if (wm.IsToolWindow) {
if (active) {
left = VisualStyleElement.Window.SmallFrameLeft.Active;
right = VisualStyleElement.Window.SmallFrameRight.Active;
bottom = VisualStyleElement.Window.SmallFrameBottom.Active;
} else {
left = VisualStyleElement.Window.SmallFrameLeft.Inactive;
right = VisualStyleElement.Window.SmallFrameRight.Inactive;
bottom = VisualStyleElement.Window.SmallFrameBottom.Inactive;
}
} else {
if (active) {
left = VisualStyleElement.Window.FrameLeft.Active;
right = VisualStyleElement.Window.FrameRight.Active;
bottom = VisualStyleElement.Window.FrameBottom.Active;
} else {
left = VisualStyleElement.Window.FrameLeft.Inactive;
right = VisualStyleElement.Window.FrameRight.Inactive;
bottom = VisualStyleElement.Window.FrameBottom.Inactive;
}
}
}
示例15: ManagedWindowGetMenuButtonVisualStyleElement
static VisualStyleElement ManagedWindowGetMenuButtonVisualStyleElement (TitleButton button, InternalWindowManager wm)
{
switch (button.Caption) {
case CaptionButton.Close:
if (ManagedWindowTitleButtonIsDisabled (button, wm))
return VisualStyleElement.Window.MdiCloseButton.Disabled;
if (ManagedWindowTitleButtonIsPressed (button))
return VisualStyleElement.Window.MdiCloseButton.Pressed;
if (button.Entered)
return VisualStyleElement.Window.MdiCloseButton.Hot;
return VisualStyleElement.Window.MdiCloseButton.Normal;
case CaptionButton.Help:
if (ManagedWindowTitleButtonIsDisabled (button, wm))
return VisualStyleElement.Window.MdiHelpButton.Disabled;
if (ManagedWindowTitleButtonIsPressed (button))
return VisualStyleElement.Window.MdiHelpButton.Pressed;
if (button.Entered)
return VisualStyleElement.Window.MdiHelpButton.Hot;
return VisualStyleElement.Window.MdiHelpButton.Normal;
case CaptionButton.Minimize:
if (ManagedWindowTitleButtonIsDisabled (button, wm))
return VisualStyleElement.Window.MdiMinButton.Disabled;
if (ManagedWindowTitleButtonIsPressed (button))
return VisualStyleElement.Window.MdiMinButton.Pressed;
if (button.Entered)
return VisualStyleElement.Window.MdiMinButton.Hot;
return VisualStyleElement.Window.MdiMinButton.Normal;
default:
if (ManagedWindowTitleButtonIsDisabled (button, wm))
return VisualStyleElement.Window.MdiRestoreButton.Disabled;
if (ManagedWindowTitleButtonIsPressed (button))
return VisualStyleElement.Window.MdiRestoreButton.Pressed;
if (button.Entered)
return VisualStyleElement.Window.MdiRestoreButton.Hot;
return VisualStyleElement.Window.MdiRestoreButton.Normal;
}
}