Click here to Skip to main content
15,889,116 members
Articles / Desktop Programming / Windows Forms

Star Trek LCARS controls for the Microsoft .NET Framework

Rate me:
Please Sign up or sign in to vote.
2.59/5 (21 votes)
21 Nov 2006CPOL3 min read 177K   1.1K   31   18
A set of controls to build LCARS computer systems.

Sample Image - lcars_net_controls.gif

Introduction

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

Today, in several Star Trek related websites, we can see the look and 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 other 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: Elbo is the component that splits the screen in different zones.
  • LCARS_Panel: Panel is a single colored rectangle. This component could be finished by round corners.
  • LCARS_Label: Label is a rectangle with a single text on it.
  • LCARS_Button: Button is the component to execute actions and interact with the user.
  • LCARS_Sound: Sound is the component to play sounds. Only plays WAV files. Some cool sounds can be downloaded here.
  • LCARS_Date: 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 and 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 once, with no waits.
  • PlayOnce (soundName, wait): In this case, the sound is played only once, but waits for the sound to terminate.
  • PlayLoop (soundName): In this case, the sound is played continuously 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 it before to close the application.

Clicks

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

C#
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 control and builds really awesome 24th century systems.

Links

History

  • 1.0.0.1: Second release, added new LCARS_Date control.
  • 1.0.0.0: First release.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Chile Chile
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questionare you still around? Pin
betterthanalemur5-Jan-10 14:02
betterthanalemur5-Jan-10 14:02 
GeneralDate error Pin
BillStewart18-Aug-09 6:44
BillStewart18-Aug-09 6:44 
QuestionRe: Date error Pin
Claudio de Biasio7-Mar-11 22:19
Claudio de Biasio7-Mar-11 22:19 
GeneralSource code Pin
Chris Lueke7-Aug-08 14:24
Chris Lueke7-Aug-08 14:24 
AnswerRe: Source code Pin
Thomas Rickenbach13-Aug-08 7:25
Thomas Rickenbach13-Aug-08 7:25 
GeneralRe: Source code Pin
WilliamSauron4-May-11 21:21
WilliamSauron4-May-11 21:21 
GeneralSource Code Please Pin
ophedian22-Feb-08 13:09
ophedian22-Feb-08 13:09 
Generalthread issue with sound Pin
marcel heeremans6-Jun-07 21:05
marcel heeremans6-Jun-07 21:05 
GeneralPoor! Pin
alspocky7-Apr-07 16:21
alspocky7-Apr-07 16:21 
GeneralHoly Mackrel Pin
NormDroid20-Mar-07 22:24
professionalNormDroid20-Mar-07 22:24 
Question** CODE ** project Pin
JaseNet28-Nov-06 8:01
JaseNet28-Nov-06 8:01 
AnswerRe: ** CODE ** project Pin
Matthew Hazlett28-Nov-06 11:04
Matthew Hazlett28-Nov-06 11:04 
GeneralTypo Pin
vocaro22-Nov-06 20:18
vocaro22-Nov-06 20:18 
AnswerRe: Typo Pin
Marcelo Chavez23-Nov-06 3:59
Marcelo Chavez23-Nov-06 3:59 
GeneralDifferent Pin
adsfasfasfasfasdfasfas22-Nov-06 3:45
adsfasfasfasfasdfasfas22-Nov-06 3:45 
AnswerRe: Different? You certainly SEEM to be! Pin
Giovannius2-Mar-09 17:51
Giovannius2-Mar-09 17:51 
Dear "cyygjwjcstsa1",

I find your commentary on the quality of science fiction cinematic production to be amusing, at best. At worst it's a little sad. At WORSE than worst, it's somewhat frightening.

I am quite familiar with both Star Trek and Star Wars, as, I'm confident, is the originator of the Microsoft LCARs control system which you are mocking. I have no desire or intention to take anything away from the Star Wars movies. In their era, they were fine pieces of entertainment.

Despite this fact, they weren't exerpts from some futuristic version of CNN. They were MOVIES. Contrary to what you might choose to believe, they NEVER actually "happened".

I must assume that your complaints against the "television series with the sets that really show they were made using cardboard" refers to the original Star Trek series. This was produced in the mid to late 1960s, when the closest thing to "special effects" in existence was shaking the camera.

The original series was incredible for the era in which it was filmed. I hate to burst your bubble, but, were it not for the "television series with the sets that really show they were made using cardboard" being produced, and produced in an era in which we landed a man on the moon with buildings full of computers that have less combined computational capacity than one of today's CELLPHONES, your "fantasy universe" of the Star Wars movies wouldn't have existed TEN YEARS LATER.

Let's leap ahead. It's the 1970s. "Episode IV ~ A New Hope" has just hit the theatres. You see some fairly impressive special effects in that film, and it captures your interest. Parts V and VI come and go, and somewhere along the line, you cross that psychological boundry that separates fandom from obsession.

Now we move ahead even further in time. "Star Trek ~ The Next Generation" is put on the air. It leads to "Deep Space 9"...then to "Voyager".
More "Star Trek" movies are produced than George Lucas even considered making when he designed his 9-part, as yet unfinished Star Wars epic. Each Star Trek movie was either on a par with its Star Wars contemporaries, or out-classed it entirely.

Suddenly, Star Wars episodes I, II, and III are filmed. I'm sure that you leapt into your landspeeder, and raced to the nearest theatre to catch its opening. I can only imagine your surprise when virtually every scene in the movies BELLOWED "LOOK! LOOK!! LOOK!!!.....CGI!!!!!!!".

When I started this reply, it was never my intention for it to be a rant. It's simply a statement of the facts. When Gene Roddenberry started Star Trek, he never expected the computer systems developed for his "cardboard set" television series to be studied by the U.S. Government, and used as pattern pieces for future computer systems; or for the design of his communicators from that series to be used as pattern pieces for cell phones [the first flip phone, made by Star TAC]. It is also simply a statement of facts.

Just as a final point, cyygjwjcstsa1, there was a huge public outcry that resulted in the President of the United States renaming America's first functional Space Shuttle "Enterprise", in honour of the original starship USS Enterprise from Star Trek. I don't want to sound like any kind of a "nay-sayer", but I really don't expect there to be too many letter writing campaigns in favour of us sending up any spaceshuttles "Millenium Falcon".

I'm sure that, at this point, you're likely to assume that I've been "seduced by the dark side", or I'm in league with the evil Emperor Palpatine; or some other such nonsense. As such, I apologise if my pointing all of these things out to you injects too much of a dose of ACTUAL reality into the universe...or at least the universe as you see it.
QuestionSource Code ? Pin
Ivan Mladenović21-Nov-06 21:51
Ivan Mladenović21-Nov-06 21:51 
AnswerRe: Source Code ? Pin
Steffen Lange22-Nov-06 9:09
Steffen Lange22-Nov-06 9:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.