Ignore:
Timestamp:
2012-02-13T17:02:43+13:00 (12 years ago)
Author:
davidb
Message:

Coloured shift and macron buttons

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/html-to-expeditee/trunk/src/bin/script/keyboard.pl

    r25056 r25077  
    228228    my $searchBoxText = "Search text goes here";
    229229   
    230     my $textAttr = {};
    231     $textAttr->{'f'} = "tb30";
    232 
    233     $expeditee_frame_io->addText($x,$y,$searchBoxText,undef,$textAttr);
    234    
    235     #add button images for 'Search' button and 'Reset' button.
     230    my $searchTextAttr = {};
     231    $searchTextAttr->{'f'} = "tb30";
     232    $searchTextAttr->{'D'} = "search text";
     233
     234    $expeditee_frame_io->addText($x,$y,$searchBoxText,undef,$searchTextAttr);
     235   
     236    #add button images for 'Search' button,'Reset' button & 'Constraint Search' button.
    236237    $x = ($x - 5) + $xr + 10;
    237238    $y -= 55;               #reset y to original value so buttons align with search box.
    238239
     240    my $textAttr = {};
    239241    $textAttr->{'X'} = "runFrame";
    240242    $textAttr->{'x'} = "false";     #set action mark.
     
    252254   
    253255    my $searchBtnText = "Search";
    254         $textAttr->{'d'} = "100 100 100";           #set text color
     256        $textAttr->{'d'} = "100 100 100";               #set text color
    255257    $expeditee_frame_io->addText($x,$y,$searchBtnText,undef,$textAttr);
    256258   
     
    265267    my $resetBtnText = "Reset";
    266268       
    267     $expeditee_frame_io->addText($x,$y,$resetBtnText,undef,$textAttr); 
     269    $expeditee_frame_io->addText($x,$y,$resetBtnText,undef,$textAttr);
     270
     271    $x += 160;
     272
     273    my $constraintsBtnText = "Constraints";
     274    $textAttr->{'F'} = "Keyboard-Actions52";            #link to frame containing Constraint Search code.
     275    $expeditee_frame_io->addText($x,$y,$constraintsBtnText,undef,$textAttr);
     276
     277    $x = ($x - 25 - 160) + $width + 10;
     278    $y -= 55;
     279    $expeditee_frame_io->addText($x,$y,$imgBtn,undef,$textAttr);   
    268280
    269281}
     
    278290sub add_key
    279291{
    280     my ($expeditee_frame_io,$label,$char,$x,$y) =@_;
     292    my ($expeditee_frame_io,$label,$char,$x,$y,$fn) =@_;
    281293
    282294    my $imgBtn = "";
     
    308320    elsif(($label eq "macron") || ($label eq "shift")) {
    309321                       
    310          
     322            my $yellowText = "100 84 16";
    311323        $imgBtn = "\@i: images/buttons/key_special.png";
    312324
    313325        $textAttr->{'f'} = "tb32";
     326       
     327        if($fn == 2 && $label eq "shift") {
     328                $textAttr->{'d'} = $yellowText;
     329        }
     330        elsif($fn == 3 && $label eq "macron") {
     331                $textAttr->{'d'} = $yellowText;
     332        }
     333        elsif($fn == 4) {
     334            $textAttr->{'d'} = $yellowText;
     335        }
     336
    314337        $width = 145;
    315338       
    316339    }
    317     elsif($label eq "Bksp"){
     340    elsif($label eq "Bksp") {
    318341       
    319342        $imgBtn = "\@i: images/buttons/key_bksp.png";
     
    348371    if($label eq "macron") {
    349372    $xl += 10;
    350         $yt += 55;
    351373    }
    352374    elsif($label eq "shift") {
    353375    $xl += 35;
    354         $yt += 55;
    355376    }
    356377    elsif($label eq "Bksp") {
    357     $xl += 55;
    358         $yt += 50;
     378    $xl += 50;
    359379    }
    360380    else {
    361381    $xl += 20;
    362         $yt += 55;
    363     }
    364 
    365 
     382    }
     383
     384    $yt += 55;
    366385
    367386
     
    410429         if ($letter_rec_type eq "") {
    411430        my $letter = $letter_rec;
    412         add_key($expeditee_frame_io,$letter,$letter,$x,$y,$default_key_width,$default_key_height); 
     431        add_key($expeditee_frame_io,$letter,$letter,$x,$y,$default_key_width,$default_key_height,$fn); 
    413432                print " $letter ";
    414433        }
     
    418437            my $char  = $letter_rec->{'char'};
    419438
    420             add_key($expeditee_frame_io,$label,$char,$x,$y);
     439            add_key($expeditee_frame_io,$label,$char,$x,$y,$fn);
    421440
    422441            print " $label ";
     
    428447            my $goto_keyboard_title = $goto_keyboard->{'title'};
    429448
    430             add_key($expeditee_frame_io,$label,$label,$x,$y);
     449            add_key($expeditee_frame_io,$label,$label,$x,$y,$fn);
    431450
    432451            print " $label ";
Note: See TracChangeset for help on using the changeset viewer.