Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A framework for monochrome Logitech gaming keyboard LCDs.

License

NotificationsYou must be signed in to change notification settings

ikkentim/LogiFrame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

LogiFrame is a framework for efficiently creating apps for G13/G15/G510 devices. You can create controls and add them to the app, much like WinForms.

Example

This example shows "Hello, World" in the top-left corner.

// Create a control.varlabel=newLCDLabel{Font=PixelFonts.Small,// The PixelFonts class contains various good fonts for LCD screens.Text="Hello, World!",AutoSize=true,};// Create an app instance.varapp=newLCDApp("Sample App",false,false,false);// Add the label control to the app.app.Controls.Add(label);// Make the app the foreground app on the LCD screen.app.PushToForeground();// A blocking call. Waits for the LCDApp instance to be disposed. (optional)app.WaitForClose();

Controls

The following controls are available in the library by default.

LCDLabel Draws text on the screen.

varlabel=newLCDLabel{Font=PixelFonts.Small,Text="Hello, World!",AutoSize=true,};

LCDLine Draws a line on the screen.

varline=newLCDLine{Start=newPoint(0,0),End=newPoint(LCDApp.DefaultSize.Width-1,LCDApp.DefaultSize.Height-1)};

LCDRectangle Draws a rectangle on the screen.

varrectangle=newLCDRectangle{Location=newPoint(0,0),Size=newSize(40,40),Style=RectangleStyle.Bordered};

LCDEllipse Draws an ellipse on the screen.

varellipse=newLCDEllipse{Location=newPoint(40,20),Size=newSize(50,20)};

LCDProgressBar Draws a progress bar on the screen.

varprogressBar=newLCDProgressBar{Location=newPoint(12,14),Size=newSize(136,6),Style=BorderStyle.Border,Direction=ProgressBarDirection.Right,Value=50};

LCDPicture Converts a picture to black-and-white and draws it on the screen.

varpicture=newLCDPicture{Location=newPoint(100,10),Size=Resources.gtech.Size,// Resources.gtech is the image we want to draw on the screen.Image=Resources.gtech,};

LCDMarquee A horizontally moving marquee, for displaying long text on the screen.

varmarq=newLCDMarquee{Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",Size=newSize(LCDApp.DefaultSize.Width,10),Location=newPoint(0,10),};

LCDSimpleGraph Draws a simple graph on the screen.

vargraph=newLCDSimpleGraph{Location=newPoint(70,30),Size=newSize(40,10),Style=BorderStyle.Border};// We'll add a random value to the graph every half a second.// 'Timer' is a class provided by LogiFrame which works much like WinForms' Timer.vartimer=newTimer{Interval=500,Enabled=true};timer.Tick+=(sender,args)=>{graph.PushValue(newRandom().Next(0,100));};

LCDTabControl/LCDTabPage A tab control much like WinForms'TabControl.

vartabPage=newLCDTabPage{Icon=newLCDLabel{AutoSize=true,Text="A",Font=PixelFonts.Title}};tabPage.Controls.Add(label);tabPage.Controls.Add(line);tabPage.Controls.Add(marq);vartabPage2=newLCDTabPage{Icon=newLCDLabel{AutoSize=true,Text="B",Font=PixelFonts.Title}};tabPage2.Controls.Add(rectangle);tabPage2.Controls.Add(ellipse);tabPage2.Controls.Add(progressBar);tabPage2.Controls.Add(picture);tabPage2.Controls.Add(graph);vartabControl=newLCDTabControl();tabControl.TabPages.Add(tabPage);tabControl.TabPages.Add(tabPage2);tabControl.SelectedTab=tabPage;

LCDControl

All controls andLCDApp inherit fromLCDControl. Below are the most important properties, methods and events inside this class.

  • public LCDControl Parent { get; private set; } Gets the parent container of the control.
  • public IMergeMethod MergeMethod { get; set; } Gets or sets the merge method used on the control when merging the rendered image in the parent container.
  • public Point Location { get; set; } Gets or sets the location of the control.
  • public int Left { get; set; } Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container.
  • public int Top { get; set; } Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container.
  • public Size Size { get; set; } Gets or sets the size of the control.
  • public int Width { get; set; } Gets or sets the width of the control.
  • public int Height { get; set; } Gets or sets the height of the control.
  • public bool Visible { get; set; } Gets or sets a value indicating whether this LCDControl is visible.
  • public bool IsDisposed { get; private set; } Gets a value indicating whether the control has been disposed of.
  • public event EventHandler VisibleChanged Occurs when the Visible property value changes.
  • public event EventHandler<LCDPaintEventArgs> Paint Occurs when the control is redrawn.
  • public event EventHandler<ButtonEventArgs> ButtonDown Occurs when a button is pressed.
  • public event EventHandler<ButtonEventArgs> ButtonUp Occurs when a button is released.
  • public event EventHandler<ButtonEventArgs> ButtonPress Occurs while a button is pressed.
  • public event EventHandler Disposed Occurs when the component is disposed by a call to the Dispose method.
  • public void Invalidate() Invalidates the entire surface of the control and causes the control to be redrawn.
  • public bool IsButtonDown(int button) Determines whether the specified button is pressed.
  • public void SuspendLayout() Suspends the usual layout logic. While the layout logic is suspended, the control won't be rendered when a property has been changed.
  • public void ResumeLayout() Resumes the usual layout logic.
  • public void Show() Displays the control to the user.
  • public void Hide() Hides the control from the user.
  • public void Dispose() Releases all resources used by the LCDControl.

About

A framework for monochrome Logitech gaming keyboard LCDs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp