Changeset 34 in svn
- Timestamp:
- Mar 25, 2015 6:15:31 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/zasc/app_c/DST_WinFrequencySetting.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/zasc/app_c/DST_WinFrequencySetting.c
r28 r34 15 15 #endif 16 16 17 extern DS_U8 newcon2_gui_banner_4line_back[];17 extern DS_U8 pin_change_back[]; 18 18 19 19 #if 0 … … 33 33 this->SetWinName(this, "FrequencySetting"); 34 34 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);; 37 37 this->rect.x = (DST_GetScreenWidth() - this->rect.w) / 2; 38 38 this->rect.y = (DST_GetScreenHeight() - this->rect.h) / 2; 39 nPos = 0; 39 40 40 41 this->SetTimeOut(this, 0); … … 95 96 this->RegisterKey(this, VK_PWR, false, 0, 0); 96 97 // background 97 this->DrawImage(this, 0, 0, newcon2_gui_banner_4line_back, false);98 this->DrawImage(this, 0, 0, pin_change_back, false); 98 99 99 100 char strText[256]; 100 101 101 int nLineHeight = (this->rect.h) / 7;102 int nLineHeight = (this->rect.h) / 6; 102 103 // title 103 this->setFontStyle(this, 18, 0xFFC8C8C8, ALIGN_MIDDLE, ALIGN_CENTER);104 this->setFontStyle(this, 21, 0xFFC8C8C8, ALIGN_MIDDLE, ALIGN_CENTER); 104 105 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 121 108 // display max 122 109 switch(nPos) 123 110 { 111 124 112 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 127 115 break; 128 116 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 135 119 break; 136 120 default:break; … … 143 127 sprintf(strText, "< Min : %d ( %dMHz ) >", rf, freq); 144 128 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)); 146 130 // display min 147 131 switch(nPos) 148 132 { 133 149 134 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 152 137 break; 153 138 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 160 141 break; 161 142 default:break; … … 169 150 170 151 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)); 172 153 // descriptor 173 this->setFontStyle(this, 1 5, 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)); 175 156 } 176 157 … … 238 219 { 239 220 int i = 0; 240 int isOn = DST_EEPROM_GetFrequencySetting();221 241 222 switch(key) 242 223 { 243 case VK_UP: 224 case VK_VOL_UP: 225 case VK_CH_UP: 226 244 227 switch(nPos) 245 228 { 229 246 230 case 0: 247 isOn = isOn ? 0 : 1; 248 DST_EEPROM_SetFrequncySetting(isOn); 231 232 for (i=0; i < 10; i++) IncreaseMinRF(); 233 249 234 break; 250 235 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 259 237 for (i=0; i < 10; i++) IncreaseMaxRF(); 260 } 238 261 239 break; 262 240 default:break; … … 266 244 break; 267 245 268 case VK_DN: 246 case VK_VOL_DN: 247 case VK_CH_DN: 248 269 249 switch(nPos) 270 250 { 251 271 252 case 0: 272 isOn = isOn ? 0 : 1; 273 DST_EEPROM_SetFrequncySetting(isOn); 253 254 for (i=0; i < 10; i++) DecreaseMinRF(); 255 274 256 break; 275 257 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 284 259 for (i=0; i < 10; i++) DecreaseMaxRF(); 285 }260 286 261 break; 287 262 default:break; … … 291 266 break; 292 267 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; 301 271 this->Show(this); 302 272 break; … … 306 276 { 307 277 case 0: 308 isOn = isOn ? 0 : 1; 309 DST_EEPROM_SetFrequncySetting(isOn); 278 DecreaseMinRF(); 310 279 break; 311 280 case 1: 312 if(isOn == 1) DecreaseMinRF(); 313 break; 314 case 2: 315 if(isOn == 1) DecreaseMaxRF(); 281 DecreaseMaxRF(); 316 282 break; 317 283 default:break; … … 325 291 { 326 292 case 0: 327 isOn = isOn ? 0 : 1; 328 DST_EEPROM_SetFrequncySetting(isOn); 293 IncreaseMinRF(); 329 294 break; 330 295 case 1: 331 if(isOn == 1) IncreaseMinRF(); 332 break; 333 case 2: 334 if(isOn == 1) IncreaseMaxRF(); 296 IncreaseMaxRF(); 335 297 break; 336 298 default:break;
Note: See TracChangeset
for help on using the changeset viewer.
