Changeset 34 in svn


Ignore:
Timestamp:
Mar 25, 2015 6:15:31 PM (11 years ago)
Author:
jglee
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zasc/app_c/DST_WinFrequencySetting.c

    r28 r34  
    1515#endif 
    1616 
    17 extern DS_U8 newcon2_gui_banner_4line_back[]; 
     17extern DS_U8 pin_change_back[]; 
    1818 
    1919#if 0 
     
    3333                this->SetWinName(this,  "FrequencySetting"); 
    3434                this->setFontStyle(this, 22, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_LEFT); 
    35                 this->rect.w = DST_GetImageWidth(newcon2_gui_banner_4line_back); 
    36                 this->rect.h = DST_GetImageHeight(newcon2_gui_banner_4line_back);; 
     35                this->rect.w = DST_GetImageWidth(pin_change_back); 
     36                this->rect.h = DST_GetImageHeight(pin_change_back);; 
    3737                this->rect.x = (DST_GetScreenWidth() - this->rect.w) / 2; 
    3838                this->rect.y = (DST_GetScreenHeight() - this->rect.h) / 2; 
     39                nPos = 0; 
    3940 
    4041                this->SetTimeOut(this, 0); 
     
    9596                                this->RegisterKey(this, VK_PWR, false, 0, 0); 
    9697                // background 
    97                 this->DrawImage(this, 0, 0, newcon2_gui_banner_4line_back, false); 
     98                this->DrawImage(this, 0, 0, pin_change_back, false); 
    9899         
    99100                char strText[256]; 
    100101                 
    101                 int nLineHeight = (this->rect.h) / 7; 
     102                int nLineHeight = (this->rect.h) / 6; 
    102103                // title 
    103                 this->setFontStyle(this, 18, 0xFFC8C8C8, ALIGN_MIDDLE, ALIGN_CENTER); 
     104                this->setFontStyle(this, 21, 0xFFC8C8C8, ALIGN_MIDDLE, ALIGN_CENTER); 
    104105                this->DrawText(this, 0, 0, this->rect.w, nLineHeight*2, (char*)"Frequency Setting", &(this->font)); 
    105                 int isOn = DST_EEPROM_GetFrequencySetting(); 
    106                 sprintf(strText, "< %s >", isOn == 1?(char*)"ON":(char*)"OFF"); 
    107                 switch(nPos) 
    108                 { 
    109                         case 0: 
    110                                 this->setFontStyle(this, 17, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 
    111                                 break; 
    112                         case 1: 
    113                                 this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
    114                                 break; 
    115                         case 2: 
    116                                 this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
    117                                 break; 
    118                         default:break; 
    119                 } 
    120                 this->DrawText(this, 0, nLineHeight * 2, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 
     106 
     107 
    121108                // display max 
    122109                switch(nPos) 
    123110                { 
     111 
    124112                        case 0: 
    125                                 this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
    126                                 if(isOn == 0) this->setFontStyle(this, 15, 0xFF666666, ALIGN_MIDDLE, ALIGN_CENTER); 
     113                                this->setFontStyle(this, 22, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 
     114                                 
    127115                                break; 
    128116                        case 1: 
    129                                 this->setFontStyle(this, 17, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 
    130                                 if(isOn == 0) this->setFontStyle(this, 15, 0xFF666666, ALIGN_MIDDLE, ALIGN_CENTER); 
    131                                 break; 
    132                         case 2: 
    133                                 this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
    134                                 if(isOn == 0) this->setFontStyle(this, 15, 0xFF666666, ALIGN_MIDDLE, ALIGN_CENTER); 
     117                                this->setFontStyle(this, 21, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
     118                                 
    135119                                break; 
    136120                        default:break; 
     
    143127                        sprintf(strText, "< Min : %d ( %dMHz ) >", rf, freq); 
    144128 
    145                 this->DrawText(this, 0, nLineHeight * 3, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 
     129                this->DrawText(this, 0, nLineHeight * 2, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 
    146130                // display min 
    147131                switch(nPos) 
    148132                { 
     133 
    149134                        case 0: 
    150                                 this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
    151                                 if(isOn == 0) this->setFontStyle(this, 15, 0xFF666666, ALIGN_MIDDLE, ALIGN_CENTER); 
     135                                this->setFontStyle(this, 21, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
     136                                 
    152137                                break; 
    153138                        case 1: 
    154                                 this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 
    155                                 if(isOn == 0) this->setFontStyle(this, 15, 0xFF666666, ALIGN_MIDDLE, ALIGN_CENTER); 
    156                                 break; 
    157                         case 2: 
    158                                 this->setFontStyle(this, 17, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 
    159                                 if(isOn == 0) this->setFontStyle(this, 15, 0xFF666666, ALIGN_MIDDLE, ALIGN_CENTER); 
     139                                this->setFontStyle(this, 22, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 
     140                                 
    160141                                break; 
    161142                        default:break; 
     
    169150 
    170151 
    171                 this->DrawText(this, 0, nLineHeight * 4, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 
     152                this->DrawText(this, 0, nLineHeight * 3, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 
    172153                // descriptor 
    173                 this->setFontStyle(this, 15, 0xFF666666, ALIGN_MIDDLE, ALIGN_CENTER); 
    174                 this->DrawText(this, 0, nLineHeight * 6, this->rect.w, nLineHeight, (char*)"Channel/Volume : Next", &(this->font)); 
     154                this->setFontStyle(this, 18, 0xFF666666, ALIGN_MIDDLE, ALIGN_CENTER); 
     155                this->DrawText(this, 0, nLineHeight * 5, this->rect.w, nLineHeight, (char*)"Up/Down : Next", &(this->font)); 
    175156        } 
    176157 
     
    238219        { 
    239220                int i = 0; 
    240                 int isOn = DST_EEPROM_GetFrequencySetting(); 
     221                 
    241222                switch(key) 
    242223                { 
    243                         case VK_UP: 
     224                        case VK_VOL_UP: 
     225                        case VK_CH_UP: 
     226                         
    244227                                switch(nPos) 
    245228                                { 
     229 
    246230                                        case 0: 
    247                                                 isOn = isOn ? 0 : 1; 
    248                                                 DST_EEPROM_SetFrequncySetting(isOn); 
     231 
     232                                                        for (i=0; i < 10; i++) IncreaseMinRF(); 
     233 
    249234                                                break; 
    250235                                        case 1: 
    251                                                 if(isOn == 1) 
    252                                                 { 
    253                                                         for (i=0; i < 10; i++) IncreaseMinRF(); 
    254                                                 } 
    255                                                 break; 
    256                                         case 2: 
    257                                                 if(isOn == 1) 
    258                                                 { 
     236 
    259237                                                        for (i=0; i < 10; i++) IncreaseMaxRF(); 
    260                                                 } 
     238 
    261239                                                break; 
    262240                                                default:break; 
     
    266244                                break; 
    267245                                 
    268                         case VK_DN: 
     246                        case VK_VOL_DN: 
     247                        case VK_CH_DN: 
     248 
    269249                                switch(nPos) 
    270250                                { 
     251 
    271252                                        case 0: 
    272                                                 isOn = isOn ? 0 : 1; 
    273                                                 DST_EEPROM_SetFrequncySetting(isOn); 
     253 
     254                                                        for (i=0; i < 10; i++) DecreaseMinRF(); 
     255                                                 
    274256                                                break; 
    275257                                        case 1: 
    276                                                 if(isOn == 1) 
    277                                                 { 
    278                                                         for (i=0; i < 10; i++) DecreaseMinRF(); 
    279                                                 } 
    280                                                 break; 
    281                                         case 2: 
    282                                                 if(isOn == 1) 
    283                                                 { 
     258 
    284259                                                        for (i=0; i < 10; i++) DecreaseMaxRF(); 
    285                                                 } 
     260                                                 
    286261                                                break; 
    287262                                                default:break; 
     
    291266                                break; 
    292267                                 
    293                         case VK_VOL_UP: 
    294                         case VK_CH_UP: 
    295                                 if(isOn == 1) nPos = (nPos+1)>2?0:(nPos+1); 
    296                                 this->Show(this);        
    297                                 break; 
    298                         case VK_VOL_DN: 
    299                         case VK_CH_DN: 
    300                                 if(isOn == 1) nPos = (nPos-1)<0?2:(nPos-1); 
     268                        case VK_UP: 
     269                        case VK_DN: 
     270                                nPos = nPos==1?0:1; 
    301271                                this->Show(this);                        
    302272                                break; 
     
    306276                                { 
    307277                                        case 0: 
    308                                                 isOn = isOn ? 0 : 1; 
    309                                                 DST_EEPROM_SetFrequncySetting(isOn); 
     278                                                DecreaseMinRF(); 
    310279                                                break; 
    311280                                        case 1: 
    312                                                 if(isOn == 1) DecreaseMinRF(); 
    313                                                 break; 
    314                                         case 2: 
    315                                                 if(isOn == 1) DecreaseMaxRF(); 
     281                                                DecreaseMaxRF(); 
    316282                                                break; 
    317283                                                default:break; 
     
    325291                                { 
    326292                                        case 0: 
    327                                                 isOn = isOn ? 0 : 1; 
    328                                                 DST_EEPROM_SetFrequncySetting(isOn); 
     293                                                IncreaseMinRF(); 
    329294                                                break; 
    330295                                        case 1: 
    331                                                 if(isOn == 1) IncreaseMinRF(); 
    332                                                 break; 
    333                                         case 2: 
    334                                                 if(isOn == 1) IncreaseMaxRF(); 
     296                                                IncreaseMaxRF(); 
    335297                                                break; 
    336298                                                default:break; 
Note: See TracChangeset for help on using the changeset viewer.