Click here to Skip to main content
6,292,426 members and growing! (11,225 online)
Email Password   helpLost your password?
Desktop Development » Miscellaneous » General     Intermediate

Star Trek LCARS controls for the Microsoft.NET framework

By Marcelo Chavez

A set of controls to build LCARS computer systems
C# 1.0.NET 1.1, WinXP, WinForms, VS.NET2003, Dev
Posted:21 Nov 2006
Views:78,108
Bookmarked:26 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
20 votes for this article.
Popularity: 3.32 Rating: 2.56 out of 5
9 votes, 45.0%
1
3 votes, 15.0%
2
1 vote, 5.0%
3
1 vote, 5.0%
4
6 votes, 30.0%
5

Sample Image - lcars_net_controls.gif

Introduction

To be honest, Star Trek is one of the mainly reasons why I love technology. Since I was a child I dreamed with these ships and its talking computers.

Today, in several Star Trek related websites we can see the look & feel of the ship's computers, named LCARS (Library Computer Access and Retrieval System). But in all of them the interfaces were developed in flash or HTML. Searching on the internet I couldn't find any components for another platforms.

Thinking about that, I developed a simple set of LCARS controls for the Microsoft.NET framework 1.1.

Background

The components included in the "LCARS_Toolbox.DLL" assembly are:

  • LCARS_Elbo: The Elbo is the component that split the screen in different zones.

  • LCARS_Panel: The Panel is a single colored rectangle. This component could be finished by round corners.

  • LCARS_Label: The Label is a rectangle with single text on it.

  • LCARS_Button: The Button is the component to execute actions and interact with the user.

  • LCARS_Sound: The Sound is the component to play sounds. Only plays �WAV� files. Some cool sounds can be downloaded here.

  • LCARS_Date: The Date is the component to display �StarDate� dates. Also offers a regular date display.

NOTES:

All the design, like colors and components, were based on the information available in http://www.lcarsdeveloper.com/.

All the components that uses text, requires the LCARS font that can be downloaded here.

The code to generate stardate dates was based over the free javascript source code available from http://www.javascriptkit.com/script/script2/stardates.shtml

Using the code

All the properties required are grouped in the "LCARS" category.

To build a LCARS terminal, you must drag & drop the different controls over the form and adjust them using your own style (all the design is visual). Then, you can add some interaction like sounds and clicks.

Sounds:

To add sounds, you must drag a LCARS_Sound component. Then, you must add some code. There are three ways to play a sound:

  • PlayOnce (soundName). In this case the sound is played only one time, with no waits.

  • PlayOnce (soundName, wait). In this case the sound is played only one time, but waits for the sound to terminate.

  • PlayLoop (soundName). In this case the sound is played continously in a loop, like background sounds. To stop a looped sound you can use the "Stop" method.

IMPORTANT: Because the sounds are played using threads, if you are using a background sound be sure to stop them before to close the application.

Clicks:

To add some click actions, you must drag a LCARS_Button component. Then, you must implements the "OnClick" event in the usual way.

void LCARS_Button5Click(object sender, System.EventArgs e)
{
        if (lCARS_Button5.Blink) {
                lCARS_Sound1.Stop();
                lCARS_Button5.Caption = "SOUND ON";
                lCARS_Button5.Blink = false;
                lCARS_Button5.BaseColor = lCARS_Button2.BaseColor;
        } else {
                lCARS_Sound1.PlayLoop("212.wav");
                lCARS_Button5.Caption = "SOUND OFF";
                lCARS_Button5.Blink = true;
                lCARS_Button5.BaseColor = "330000";
        }
}

The LCARS_Button also includes some cool properties like the internal optional sound ("SoundFile"), the text property ("Caption"), and the blink feature (�Blink�).

Points of Interest

In the included sample you will see a simple LCARS terminal that shows an image viewer with sounds. To compile, execute the �c.bat� file. Don't forget to install the LCARS font.

If you are a Star Trek fan, I hope that you enjoy this controls and build a really awesome 24th century systems.

Links

History

  • 1.0.0.1, second release, add new LCARS_Date control

  • 1.0.0.0, first release



License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Marcelo Chavez


Member

Occupation: Web Developer
Location: Chile Chile

Other popular Miscellaneous articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 14 of 14 (Total in Forum: 14) (Refresh)FirstPrevNext
GeneralSource code PinmemberChris Lueke15:24 7 Aug '08  
AnswerRe: Source code PinmemberThomas Rickenbach8:25 13 Aug '08  
GeneralSource Code Please Pinmemberophedian14:09 22 Feb '08  
Generalthread issue with sound Pinmembermarcel heeremans22:05 6 Jun '07  
GeneralPoor! Pinmemberalspocky17:21 7 Apr '07  
GeneralHoly Mackrel Pinmembernorm .net23:24 20 Mar '07  
Question** CODE ** project PinmemberJaseNet9:01 28 Nov '06  
AnswerRe: ** CODE ** project PinmemberMatthew Hazlett12:04 28 Nov '06  
GeneralTypo Pinmembervocaro21:18 22 Nov '06  
AnswerRe: Typo PinmemberMarcelo Chavez4:59 23 Nov '06  
GeneralDifferent Pinmembercyygjwjcstsa14:45 22 Nov '06  
AnswerRe: Different? You certainly SEEM to be! PinmemberGiovannius18:51 2 Mar '09  
GeneralSource Code ? PinmemberIvan Mladenovic22:51 21 Nov '06  
GeneralRe: Source Code ? PinmemberSteffen Lange10:09 22 Nov '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 21 Nov 2006
Editor:
Copyright 2006 by Marcelo Chavez
Everything else Copyright © CodeProject, 1999-2009
Web20 | Advertise on the Code Project