Monday, April 09, 2007

GTD my way

Getting things done seems to be a new lifestyle but it's only new for the people that do only talking. Lifehacker is a blog devoted to make you do things with the least amount of time spend on additional tasks. Some ideas are good but i have a feeling other posts just want to sell you software.

If you already read my blog you know i already tried to improve working with windows but there are some changes which i want to share with you.

The software


There are only 3 applications that make me more productive and help me to give a better overview of my tasks.

Launchy : using the key combination alt+spacebar i never have to click on the startbutton to find an application or a folder.

TaskSwitchXP : alt+tab is already a powerful key combination of windons but this applications adds screenshots and it remembers the previous application for fast switching. It also lets you not only select through the key combination but holding the keys it lets you select with your mouse.

Yod'm 3d : the most recent addition. Virtual desktops are old news but the cube view made it more attractive and understandable. The key combination is alt+control+arrow key.

How i make it work for me


Hiding the taskbar is the first thing when i set up windows. It only is a distraction and with taskswitchxp you don't need to click on the applications to show them.

Setting up the system is easy. Because most of my time i use the browser it goes on the first virtual desktop together with my email application, this is my internet desktop. Using yod'm 3d keys(left arrow) i go to the second desktop to open explorer, this is my file desktop. using the right arrow yod keys twice i set up my development desktop. The ide application i need and other tools.

Now everything is set up i can go to work. I open each application full screen so other applications don't distract me. Because of this setup i only have a few applications to screen through to find the right one.

Improvements


I open my browser and my email client from startup. I could open explorer too but i don't know how to set it default to the desktop on the left.

Because yod'm 3d doesn't allow to scroll vertical through the desktops i'm limited to three quick accessible desktops instead of five.

Not every application is accessible through launchy but using bat shortcuts it's possible.

These key combinations can be changed and desktops can be adjusted to your own needs. The speed improvement lays in the quick access to short lists of applications.

Friday, April 06, 2007

The imagebutton

This week i needed a table with buttons to manipulate the individual rows. My first instinct was to use button tags so i could use their value instead of a hidden input but that was without thinking about internet explorer so i used the imagebutton.

The problem in internet explorer is that the value is always the text of the button. the image button is just an input tag with image as type. To make the button unique just add a number after the name.

for($i=0;$i<10;$i++){
?><p><input type="image" name="button<?php echo $i; ?>" src="image.jpg" value="button"></p><?php
}

Now there are ten unique buttons. The following step is to get the button from the post array. In the example we have a limited, static number of buttons but if it's a databasetable you need to connect the buttons with and unique field in the database so there can't occur any mistakes.
Because $_POST['button0'] will only return the button text in internet explorer so you need to use the mouse click coordinates of the button that get send. The coordinates are button0_x and button0_y.

for($i=0;$i<10;$i++){
if(strlen(array_search('button'.$i.'_x',array_keys($_POST))) > 0){
// do something
}
}

Now that you know click coordinates are send you can use them to make one button act as two.

$click = $_POST['test_x'];
if($click > 24){
$test = 'Delete button';
}else{
$test = 'Update button';
}

The previous code is the code i used on the example page.

conclusion


The image button can spare you an hidden input and act as two buttons.