Changeset 19 in svn for trunk/zasc/app_c/DST_WinFrequencySetting.c
- Timestamp:
- Mar 25, 2015 3:42:26 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/zasc/app_c/DST_WinFrequencySetting.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/zasc/app_c/DST_WinFrequencySetting.c
r18 r19 93 93 { 94 94 this->RegisterAllKey(this); 95 // background 95 96 this->DrawImage(this, 0, 0, newcon2_gui_banner_4line_back, false); 96 97 97 98 98 int nLineHeight = (this->rect.h) / 6; 99 99 // title 100 100 this->setFontStyle(this, 18, 0xFFC8C8C8, ALIGN_MIDDLE, ALIGN_CENTER); 101 101 this->DrawText(this, 0, 0, this->rect.w, nLineHeight*2, (char*)"Frequency Setting", &(this->font)); 102 102 // display max 103 if (nPos == 0) 104 { 105 this->setFontStyle(this, 17, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 106 } 107 else 108 { 109 this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 110 } 111 int num = DST_EEPROM_GetMinRF(); 103 112 char strText[256]; 104 int num = DST_EEPROM_GetMinRF(); 105 int rf = DST_GetFrequencyNumberbyIndex(num); 106 int freq = DST_GetMHzFrequencybyIndex(num); 113 if (num > 0) 114 { 115 int rf = DST_GetFrequencyNumberbyIndex(num); 116 int freq = DST_GetMHzFrequencybyIndex(num); 117 sprintf(strText, "< Min : %d ( %dMHz ) >", rf, freq); 118 } 119 else 120 { 121 sprintf(strText, "< Min : OFF >"); 122 } 123 this->DrawText(this, 0, nLineHeight * 2, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 124 // display min 107 125 if (nPos == 0) 108 126 { 127 this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 128 } 129 else 130 { 109 131 this->setFontStyle(this, 17, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 110 sprintf(strText, "< Min : %d ( %dMHz ) >", rf, freq); 111 } 112 else 113 { 114 this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 115 sprintf(strText, "Min : %d ( %dMHz )", rf, freq); 116 } 117 this->DrawText(this, 0, nLineHeight * 2, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 118 132 } 119 133 num = DST_EEPROM_GetMaxRF(); 120 rf = DST_GetFrequencyNumberbyIndex(num); 121 freq = DST_GetMHzFrequencybyIndex(num); 122 if (nPos == 0) 123 { 124 this->setFontStyle(this, 15, 0xFFAAAAAA, ALIGN_MIDDLE, ALIGN_CENTER); 125 sprintf(strText, "Max : %d ( %dMHz )", rf, freq); 126 } 127 else 128 { 129 this->setFontStyle(this, 17, 0xFFFFFFFF, ALIGN_MIDDLE, ALIGN_CENTER); 134 if (num > 0) 135 { 136 int rf = DST_GetFrequencyNumberbyIndex(num); 137 int freq = DST_GetMHzFrequencybyIndex(num); 130 138 sprintf(strText, "< Max : %d ( %dMHz ) >", rf, freq); 131 139 } 132 140 else 141 { 142 sprintf(strText, "< Max : OFF >"); 143 } 133 144 this->DrawText(this, 0, nLineHeight * 3, this->rect.w, nLineHeight, (char*)strText, &(this->font)); 134 145 // descriptor 135 146 this->setFontStyle(this, 15, 0xFF666666, ALIGN_MIDDLE, ALIGN_CENTER); 136 147 this->DrawText(this, 0, nLineHeight * 5, this->rect.w, nLineHeight, (char*)"Channel/Volume : Next", &(this->font)); … … 141 152 void IncreaseMaxRF() 142 153 { 154 if (DST_EEPROM_GetMaxRF() >= DST_MaxRF()) 155 { 156 DST_EEPROM_SetMaxRF(DST_MaxRF()); 157 return; 158 } 143 159 DST_EEPROM_SetMaxRF(DST_EEPROM_GetMaxRF() + 1); 144 160 } 145 161 void DecreaseMinRF() 146 162 { 163 if (DST_EEPROM_GetMinRF() < DST_MinRF()) 164 { 165 DST_EEPROM_SetMinRF(-1); 166 return; 167 } 147 168 DST_EEPROM_SetMinRF(DST_EEPROM_GetMinRF() - 1); 148 169 } 149 170 void IncreaseMinRF() 150 171 { 172 if (DST_EEPROM_GetMinRF() >= DST_MinRF()) 173 { 174 DST_EEPROM_SetMinRF(DST_MinRF()); 175 return; 176 } 151 177 DST_EEPROM_SetMinRF(DST_EEPROM_GetMinRF() + 1); 152 if (DST_EEPROM_GetMaxRF() - DST_EEPROM_GetMinRF() < 4)153 {154 IncreaseMaxRF();155 }156 if (DST_EEPROM_GetMaxRF() - DST_EEPROM_GetMinRF() < 4)157 {158 DST_EEPROM_SetMinRF(DST_EEPROM_GetMaxRF()-4);159 }160 178 } 161 179 void DecreaseMaxRF() 162 180 { 181 if (DST_EEPROM_GetMaxRF() < DST_MaxRF()) 182 { 183 DST_EEPROM_SetMaxRF(-1); 184 return; 185 } 163 186 DST_EEPROM_SetMaxRF(DST_EEPROM_GetMaxRF() - 1); 164 if (DST_EEPROM_GetMaxRF() - DST_EEPROM_GetMinRF() < 4)165 {166 DecreaseMinRF();167 }168 if (DST_EEPROM_GetMaxRF() - DST_EEPROM_GetMinRF() < 4)169 {170 DST_EEPROM_SetMaxRF(DST_EEPROM_GetMinRF()+4);171 }172 187 } 173 188 void CFrequncySettingWin_KeyInput(CWindow *this, DS_U8 key, bool bRepeat)
Note: See TracChangeset
for help on using the changeset viewer.
