Changeset 887


Ignore:
Timestamp:
Oct 26, 2009, 10:45:22 AM (10 years ago)
Author:
bruno
Message:

Calculate width in function of screen size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • projects/CDDBeditor/devel/CDDBeditor/bin/CDDBeditor

    r864 r887  
    203203
    204204my $flag = NEWT_ENTRY_SCROLL;
    205 my $width = 40;
     205# Need 23 char for track and time
     206my $width = $ce_sl - 23;
     207# Othe fields are limited to 5
     208my $width2 = 5;
    206209my $host_entry = Newt::Entry($width, $flag, $ce_config{"CDDB_HOST"});
    207 $width = 5;
    208 my $port_entry = Newt::Entry($width, $flag, $ce_config{"CDDB_PORT"});
     210my $port_entry = Newt::Entry($width2, $flag, $ce_config{"CDDB_PORT"});
    209211my $mode_group;
    210212my $proxy_entry = undef;
    211213$mode_group = Newt::HRadiogroup($ce_cddb_mode{"0"}, $ce_cddb_mode{"1"});
    212214if ($ce_config{"CDDB_MODE"} eq "http" ) {
    213     $width = 40;
    214215    $proxy_entry = Newt::Entry($width, $flag, $ce_config{"HTTP_PROXY"});
    215216}
    216 $width = 40;
    217217my $dev_entry = Newt::Entry($width, $flag, $ce_config{"CD_DEVICE"});
    218218my $user_group;
     
    304304    if ($firsttime == 1) {
    305305        my %ce_cd = get_cddb(\%ce_config);
    306         $ce_cd = \%ce_cd;
     306        $ce_cd = \%ce_cd if (defined %ce_cd);
    307307    }
    308308    $firsttime = 0;
     
    381381    # Components
    382382    $flag = NEWT_ENTRY_SCROLL;
    383     $width = 40;
    384383    $artist_entry = Newt::Entry($width, $flag, $ce_cd->{artist});
    385384    $title_entry = Newt::Entry($width, $flag, $ce_cd->{title});
     
    389388    $genre_entry = Newt::Entry($width, $flag, $ce_cd->{genre});
    390389    $tno_entry = Newt::Label($ce_cd->{tno}."   -   ".$id_label.$ce_cd->{id}."   -   ".$rev_label.$ce_cd->{revision});
    391     $width = 5;
    392     $year_entry = Newt::Entry($width, $flag, $ce_cd->{year});
     390    $year_entry = Newt::Entry($width2, $flag, $ce_cd->{year});
    393391   
    394392    # Build interface
     
    420418
    421419    my $n=0;
    422     $width = 40;
    423420    while ( $n < $ce_cd->{tno} ) {
    424421        last if ($n > $ce_sh - 9);
     
    471468    if ($data->Tag() eq "Send") {
    472469        $flag = NEWT_FLAG_WRAP;
    473         $width = 40;
    474470        my $height = 10;
    475471
Note: See TracChangeset for help on using the changeset viewer.