Showing posts with label UI. Show all posts
Showing posts with label UI. Show all posts
Friday, 1 February 2008
Thursday, 31 January 2008
JDarkRoom : A simple full-screen text editor
About JDarkRoomJDarkRoom is a popular, simple full-screen text file editor with none of the usual bells and whistles that might distract you from the job in hand. If you are writing a novel, essay, thesis or just need to be able to concentrate on your writing, then JDarkRoom may help you. I have released JDarkRoom under the umbrella of CodeAlchemists. Please donate if you find this software useful - it encourages me to add features and fix bugs. The development of JDarkRoom was heavily inspired by DarkRoom, an implementation of WriteRoom (which is a Mac-only application) for Windows, but DarkRoom requires the Microsoft .NET framework. I decided to create my own implementation in Java for those that prefer not to use .NET.
Download
To run JDarkRoom, you need to have Java 1.4 or greater installed. Mac OS X comes pre-loaded with Java so you don't need to worry.
JDarkRoom version 12
Windows (installer)
(198KB)
Mac (application)
(245KB)
Mac / Linux (JAR file)
(119KB)Once the program has fully downloaded, you should be able to double-click on it and it should run straightaway. If you download the JAR version, an alternative is to open a command prompt, navigate to the directory where you downloaded the program, then type java -jar JDarkRoom.jarMac users: You should be able to double-click the downloaded ZIP file, open the JDarkRoom directory, then drag JDarkRoom to your Applications folder, or to the Dock.NB: Thanks to Dane Velasquez for preparing the .app file for the Mac.
Latest changes:
Adjustable margins to fit any screen resolution (F9 to reset)
Text search (F7 / Ctrl-F)
Colour selection mode now defaults to 'text' rather than 'dialog' (solving a problem for some Mac OS X users)
Auto-save backups - so you never lose your work again (applies to new and pre-existing files)
File names specified on the command line can now contain spaces
You can override the default 'conf' directory location (see below)
Download
To run JDarkRoom, you need to have Java 1.4 or greater installed. Mac OS X comes pre-loaded with Java so you don't need to worry.
JDarkRoom version 12
Windows (installer)
(198KB)
Mac (application)
(245KB)
Mac / Linux (JAR file)
(119KB)Once the program has fully downloaded, you should be able to double-click on it and it should run straightaway. If you download the JAR version, an alternative is to open a command prompt, navigate to the directory where you downloaded the program, then type java -jar JDarkRoom.jarMac users: You should be able to double-click the downloaded ZIP file, open the JDarkRoom directory, then drag JDarkRoom to your Applications folder, or to the Dock.NB: Thanks to Dane Velasquez for preparing the .app file for the Mac.
Latest changes:
Adjustable margins to fit any screen resolution (F9 to reset)
Text search (F7 / Ctrl-F)
Colour selection mode now defaults to 'text' rather than 'dialog' (solving a problem for some Mac OS X users)
Auto-save backups - so you never lose your work again (applies to new and pre-existing files)
File names specified on the command line can now contain spaces
You can override the default 'conf' directory location (see below)
Sunday, 23 December 2007
Updating the UI from a Secondary Thread
[Full article]In my January 2004 column I discussed the use of delegates to execute a method asynchronously. I showed you that it's relatively easy to call BeginInvoke on a delegate object from the code behind a Windows® Form in order to dispatch an asynchronous method call. You also saw how to set up a callback method that fires automatically when the asynchronous method call completes its execution. However, I stopped short of talking about how you should update the UI to tell the user that the work is complete.
Updating user interface elements from a secondary thread in Windows Forms is tricky because a secondary thread is not allowed to read or write property values directly from a form or any of its child controls. This restriction exists because form objects and control objects in Windows Forms are not thread-safe. The only thread that's allowed to directly access a property value of a form or one of its controls is the primary UI thread. You must learn how to update the user interface without breaking this rule.
The technique you're going to learn here involves writing code to switch control to the primary UI thread from the secondary thread where it's executing—a process known as marshaling. This will allow you to update the UI safely and reliably. Once you switch control from a secondary thread to the primary UI thread, you are free to change any property values of a form and its child controls.
Updating user interface elements from a secondary thread in Windows Forms is tricky because a secondary thread is not allowed to read or write property values directly from a form or any of its child controls. This restriction exists because form objects and control objects in Windows Forms are not thread-safe. The only thread that's allowed to directly access a property value of a form or one of its controls is the primary UI thread. You must learn how to update the user interface without breaking this rule.
The technique you're going to learn here involves writing code to switch control to the primary UI thread from the secondary thread where it's executing—a process known as marshaling. This will allow you to update the UI safely and reliably. Once you switch control from a secondary thread to the primary UI thread, you are free to change any property values of a form and its child controls.
Wednesday, 19 December 2007
Subscribe to:
Posts (Atom)