1 /*******************************************************************
\r
5 * Author: Peter van Sebille (peter@yipton.net)
\r
7 * Modified/adapted for picodriveN by notaz, 2006
\r
9 * (c) Copyright 2006, notaz
\r
10 * (c) Copyright 2002, Peter van Sebille
\r
11 * All Rights Reserved
\r
13 *******************************************************************/
\r
15 #include "Dialogs.h"
\r
17 #include "picodriven.hrh"
\r
18 #include "picodriven.rsg"
\r
20 #include "../version.h"
\r
21 #include "CSimpleTextParser.h"
\r
22 #include <txtrich.h> // CRichText
\r
23 #include <eikrted.h> // CEikRichTextEditor
\r
24 #include <qikvertoptionbuttonlist.h> // CEikHorOptionButtonList
\r
25 #include <eikopbut.h> // CEikOptionButton
\r
26 #include <QuartzKeys.h> // EQuartzKeyTwoWayDown
\r
29 /************************************************
\r
33 ************************************************/
\r
35 CPicoConfigDialog::CPicoConfigDialog(TPicoConfig &cfg, TPLauncherConfig &cfgl) : config(cfg), config_l(cfgl)
\r
39 void CPicoConfigDialog::PostLayoutDynInitL()
\r
41 CEikHorOptionButtonList *buttons_rot = (CEikHorOptionButtonList*) Control( ECtlOptRotation );
\r
42 CEikHorOptionButtonList *buttons_disp = (CEikHorOptionButtonList*) Control( ECtlOptScreenMode );
\r
43 CEikCheckBox *chkbox_altrend= (CEikCheckBox*) Control( ECtlOptUseAltRend );
\r
44 CEikCheckBox *chkbox_acctmng= (CEikCheckBox*) Control( ECtlOptUseAccTiming );
\r
45 CEikCheckBox *chkbox_sram = (CEikCheckBox*) Control( ECtlOptUseSRAM );
\r
46 CEikCheckBox *chkbox_fps = (CEikCheckBox*) Control( ECtlOptShowFPS );
\r
47 CEikCheckBox *chkbox_sound = (CEikCheckBox*) Control( ECtlOptEnableSound );
\r
48 CEikCheckBox *chkbox_z80 = (CEikCheckBox*) Control( ECtlOptEmulateZ80 );
\r
49 CEikCheckBox *chkbox_ym2612 = (CEikCheckBox*) Control( ECtlOptEmulateYM2612 );
\r
50 CEikCheckBox *chkbox_sn76496= (CEikCheckBox*) Control( ECtlOptEmulateSN76496 );
\r
51 CEikChoiceListBase *combo_sndq = (CEikChoiceListBase*) Control( ECtlOptSndQuality );
\r
52 CEikCheckBox *chkbox_6bpad = (CEikCheckBox*) Control( ECtlOpt6ButtonPad );
\r
53 CEikCheckBox *chkbox_gzipst = (CEikCheckBox*) Control( ECtlOptGzipStates );
\r
54 CEikCheckBox *chkbox_motvol = (CEikCheckBox*) Control( ECtlOptMotDontUseVol );
\r
55 CEikCheckBox *chkbox_accsprt= (CEikCheckBox*) Control( ECtlOptUseAccSprites );
\r
56 CEikChoiceListBase *combo_region = (CEikChoiceListBase*) Control( ECtlOptRegion );
\r
57 CEikOptionButton *opt_fit2 = (CEikOptionButton*) buttons_disp->ComponentControl( TPicoConfig::PMFit2 );
\r
59 buttons_rot ->SetButtonById(ECtlOptRotation0 + config.iScreenRotation);
\r
60 buttons_disp->SetButtonById(ECtlOptScreenModeCenter + config.iScreenMode);
\r
61 chkbox_sram ->SetState(config.iFlags & 1 ? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
62 chkbox_fps ->SetState(config.iFlags & 2 ? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
63 chkbox_sound ->SetState(config.iFlags & 4 ? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
64 chkbox_motvol ->SetState(config.iFlags & 0x40 ? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
65 chkbox_gzipst ->SetState(config.iFlags & 0x80 ? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
66 chkbox_z80 ->SetState(config.iPicoOpt & 4 ? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
67 chkbox_ym2612 ->SetState(config.iPicoOpt & 1 ? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
68 chkbox_sn76496->SetState(config.iPicoOpt & 2 ? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
69 chkbox_altrend->SetState(config.iPicoOpt & 0x10? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
70 chkbox_6bpad ->SetState(config.iPicoOpt & 0x20? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
71 chkbox_acctmng->SetState(config.iPicoOpt & 0x40? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
72 chkbox_accsprt->SetState(config.iPicoOpt & 0x80? CEikButtonBase::ESet : CEikButtonBase::EClear);
\r
74 // hide "fit2" if we are not in 0 or 180 mode
\r
75 if(config.iScreenRotation != TPicoConfig::PRot0 && config.iScreenRotation != TPicoConfig::PRot180) opt_fit2->MakeVisible(EFalse);
\r
76 // dim some stuff for alternative renderer
\r
77 if(config.iPicoOpt & 0x10) {
\r
78 buttons_disp->SetDimmed(ETrue);
\r
79 ((CEikOptionButton*)(buttons_rot->ComponentControl(TPicoConfig::PRot0)))->SetDimmed(ETrue);
\r
80 ((CEikOptionButton*)(buttons_rot->ComponentControl(TPicoConfig::PRot180)))->SetDimmed(ETrue);
\r
82 // dim accurate sprites
\r
83 if(config.iPicoOpt & 0x10) {
\r
84 chkbox_accsprt->SetState(CEikButtonBase::EClear);
\r
85 chkbox_accsprt->SetDimmed(ETrue);
\r
88 TInt sel = (config.iPicoOpt&8) ? 4 : 0;
\r
89 sel+= (config.iFlags>>3)&3;
\r
90 combo_sndq->SetCurrentItem(sel);
\r
91 switch(config.PicoRegion) {
\r
92 case 1: sel = 4; break;
\r
93 case 2: sel = 3; break;
\r
94 case 4: sel = 2; break;
\r
95 case 8: sel = 1; break;
\r
96 default:sel = 0; // auto
\r
98 combo_region->SetCurrentItem(sel);
\r
101 TBool CPicoConfigDialog::OkToExitL(TInt aButtonId)
\r
103 if(aButtonId != EEikBidOk) return ETrue;
\r
105 CEikHorOptionButtonList *buttons_rot = (CEikHorOptionButtonList*) Control( ECtlOptRotation );
\r
106 CEikHorOptionButtonList *buttons_disp = (CEikHorOptionButtonList*) Control( ECtlOptScreenMode );
\r
107 CEikCheckBox *chkbox_altrend= (CEikCheckBox*) Control( ECtlOptUseAltRend );
\r
108 CEikCheckBox *chkbox_acctmng= (CEikCheckBox*) Control( ECtlOptUseAccTiming );
\r
109 CEikCheckBox *chkbox_sram = (CEikCheckBox*) Control( ECtlOptUseSRAM );
\r
110 CEikCheckBox *chkbox_fps = (CEikCheckBox*) Control( ECtlOptShowFPS );
\r
111 CEikCheckBox *chkbox_sound = (CEikCheckBox*) Control( ECtlOptEnableSound );
\r
112 CEikCheckBox *chkbox_z80 = (CEikCheckBox*) Control( ECtlOptEmulateZ80 );
\r
113 CEikCheckBox *chkbox_ym2612 = (CEikCheckBox*) Control( ECtlOptEmulateYM2612 );
\r
114 CEikCheckBox *chkbox_sn76496= (CEikCheckBox*) Control( ECtlOptEmulateSN76496 );
\r
115 CEikChoiceListBase *combo_sndq = (CEikChoiceListBase*) Control( ECtlOptSndQuality );
\r
116 CEikCheckBox *chkbox_6bpad = (CEikCheckBox*) Control( ECtlOpt6ButtonPad );
\r
117 CEikCheckBox *chkbox_gzipst = (CEikCheckBox*) Control( ECtlOptGzipStates );
\r
118 CEikCheckBox *chkbox_motvol = (CEikCheckBox*) Control( ECtlOptMotDontUseVol );
\r
119 CEikCheckBox *chkbox_accsprt= (CEikCheckBox*) Control( ECtlOptUseAccSprites );
\r
120 CEikChoiceListBase *combo_region = (CEikChoiceListBase*) Control( ECtlOptRegion );
\r
122 config.iScreenRotation = (TPicoConfig::TPicoScreenRotation) (buttons_rot->LabeledButtonId() - ECtlOptRotation0);
\r
123 config.iScreenMode = (TPicoConfig::TPicoScreenMode) (buttons_disp->LabeledButtonId() - ECtlOptScreenModeCenter);
\r
125 if(chkbox_sram ->State() == CEikButtonBase::ESet) config.iFlags |= 1; else config.iFlags &= ~1;
\r
126 if(chkbox_fps ->State() == CEikButtonBase::ESet) config.iFlags |= 2; else config.iFlags &= ~2;
\r
127 if(chkbox_sound ->State() == CEikButtonBase::ESet) config.iFlags |= 4; else config.iFlags &= ~4;
\r
128 if(chkbox_motvol ->State() == CEikButtonBase::ESet) config.iFlags |= 0x40; else config.iFlags &= ~0x40;
\r
129 if(chkbox_gzipst ->State() == CEikButtonBase::ESet) config.iFlags |= 0x80; else config.iFlags &= ~0x80;
\r
130 if(chkbox_z80 ->State() == CEikButtonBase::ESet) config.iPicoOpt |= 4; else config.iPicoOpt &= ~4;
\r
131 if(chkbox_ym2612 ->State() == CEikButtonBase::ESet) config.iPicoOpt |= 1; else config.iPicoOpt &= ~1;
\r
132 if(chkbox_sn76496->State() == CEikButtonBase::ESet) config.iPicoOpt |= 2; else config.iPicoOpt &= ~2;
\r
133 if(chkbox_altrend->State() == CEikButtonBase::ESet) config.iPicoOpt |= 0x10;else config.iPicoOpt &= ~0x10;
\r
134 if(chkbox_6bpad ->State() == CEikButtonBase::ESet) config.iPicoOpt |= 0x20;else config.iPicoOpt &= ~0x20;
\r
135 if(chkbox_acctmng->State() == CEikButtonBase::ESet) config.iPicoOpt |= 0x40;else config.iPicoOpt &= ~0x40;
\r
136 if(chkbox_accsprt->State() == CEikButtonBase::ESet) config.iPicoOpt |= 0x80;else config.iPicoOpt &= ~0x80;
\r
138 TInt sel = combo_sndq->CurrentItem();
\r
139 if(sel > 3) { config.iPicoOpt |= 8; sel-=4; } else config.iPicoOpt &= ~8;
\r
140 config.iFlags &= ~0x18;
\r
141 config.iFlags |= (sel<<3)&0x18;
\r
143 switch(combo_region->CurrentItem()) {
\r
144 case 4: config.PicoRegion = 1; break;
\r
145 case 3: config.PicoRegion = 2; break;
\r
146 case 2: config.PicoRegion = 4; break;
\r
147 case 1: config.PicoRegion = 8; break;
\r
148 default:config.PicoRegion = 0; // auto
\r
154 // simple GUI stuff needs lots of code
\r
155 void CPicoConfigDialog::HandleControlStateChangeL(TInt aControlId)
\r
157 if(aControlId == ECtlOptEnableSound) {
\r
158 CEikCheckBox *chkbox_sound = (CEikCheckBox*) Control( ECtlOptEnableSound );
\r
159 CEikCheckBox *chkbox_z80 = (CEikCheckBox*) Control( ECtlOptEmulateZ80 );
\r
160 CEikCheckBox *chkbox_ym2612 = (CEikCheckBox*) Control( ECtlOptEmulateYM2612 );
\r
161 CEikCheckBox *chkbox_sn76496= (CEikCheckBox*) Control( ECtlOptEmulateSN76496 );
\r
163 if(chkbox_sound->State() == CEikButtonBase::ESet) {
\r
164 // check all sound chips too, but only if they all are not set
\r
165 if((chkbox_z80->State() | chkbox_ym2612->State() | chkbox_sn76496->State()) == CEikButtonBase::EClear) { // (==0)
\r
166 chkbox_z80 ->SetState(CEikButtonBase::ESet);
\r
167 chkbox_ym2612 ->SetState(CEikButtonBase::ESet);
\r
168 chkbox_sn76496->SetState(CEikButtonBase::ESet);
\r
169 chkbox_z80 ->DrawDeferred();
\r
170 chkbox_ym2612 ->DrawDeferred();
\r
171 chkbox_sn76496->DrawDeferred();
\r
174 // clear everything, but only if everything is set
\r
175 if((chkbox_z80->State() & chkbox_ym2612->State() & chkbox_sn76496->State()) == CEikButtonBase::ESet) { // (==1)
\r
176 chkbox_z80 ->SetState(CEikButtonBase::EClear);
\r
177 chkbox_ym2612 ->SetState(CEikButtonBase::EClear);
\r
178 chkbox_sn76496->SetState(CEikButtonBase::EClear);
\r
179 chkbox_z80 ->DrawDeferred();
\r
180 chkbox_ym2612 ->DrawDeferred();
\r
181 chkbox_sn76496->DrawDeferred();
\r
184 } else if(aControlId == ECtlOptUseAltRend) {
\r
185 CEikCheckBox *chkbox_altrend= (CEikCheckBox*) Control( ECtlOptUseAltRend );
\r
186 CEikCheckBox *chkbox_accsprt= (CEikCheckBox*) Control( ECtlOptUseAccSprites );
\r
187 CEikHorOptionButtonList *buttons_rot = (CEikHorOptionButtonList*) Control( ECtlOptRotation );
\r
188 CEikHorOptionButtonList *buttons_disp = (CEikHorOptionButtonList*) Control( ECtlOptScreenMode );
\r
190 TBool dimmed = chkbox_altrend->State() == CEikButtonBase::ESet;
\r
191 // show/hide more stuff for alternative renderer
\r
192 buttons_disp->SetDimmed(dimmed);
\r
193 chkbox_accsprt->SetDimmed(dimmed);
\r
194 ((CEikOptionButton*)(buttons_rot->ComponentControl(TPicoConfig::PRot0)))->SetDimmed(dimmed);
\r
195 ((CEikOptionButton*)(buttons_rot->ComponentControl(TPicoConfig::PRot180)))->SetDimmed(dimmed);
\r
196 if(dimmed && buttons_rot->LabeledButtonId() != ECtlOptRotation90 && buttons_rot->LabeledButtonId() != ECtlOptRotation270) {
\r
197 buttons_rot->SetButtonById(ECtlOptRotation90);
\r
198 aControlId = ECtlOptRotation; // cause rotation update
\r
200 buttons_disp->SetButtonById(ECtlOptScreenModeCenter);
\r
201 chkbox_accsprt->DrawDeferred();
\r
202 buttons_disp->DrawDeferred();
\r
203 buttons_rot->DrawDeferred();
\r
205 if(aControlId == ECtlOptRotation) {
\r
206 CEikHorOptionButtonList *buttons_rot = (CEikHorOptionButtonList*) Control( ECtlOptRotation );
\r
207 CEikHorOptionButtonList *buttons_disp = (CEikHorOptionButtonList*) Control( ECtlOptScreenMode );
\r
208 CEikOptionButton *opt_fit2 = (CEikOptionButton*) buttons_disp->ComponentControl( TPicoConfig::PMFit2 );
\r
210 if(buttons_rot->LabeledButtonId() == ECtlOptRotation0 || buttons_rot->LabeledButtonId() == ECtlOptRotation180) {
\r
211 opt_fit2->MakeVisible(ETrue);
\r
212 opt_fit2->DrawDeferred();
\r
214 if(opt_fit2->State() == CEikButtonBase::ESet) {
\r
215 buttons_disp->SetButtonById(ECtlOptScreenModeFit);
\r
216 buttons_disp->DrawDeferred();
\r
218 opt_fit2->MakeVisible(EFalse);
\r
224 /*************************************************************
\r
228 **************************************************************/
\r
230 void CCreditsDialog::PreLayoutDynInitL()
\r
232 CDesCArrayFlat* desArray = CEikonEnv::Static()->ReadDesCArrayResourceL(iMessageResourceID);
\r
233 CleanupStack::PushL(desArray);
\r
236 TInt count = desArray->Count();
\r
237 for (TInt i=0 ;i < count; i++)
\r
239 iLength = static_cast<CEikGlobalTextEditor*>(Control(ECtlCredits))->TextLength();
\r
240 static_cast<CEikGlobalTextEditor*>(Control(ECtlCredits))->Text()->InsertL(iLength, desArray->operator[](i));
\r
241 iLength = static_cast<CEikGlobalTextEditor*>(Control(ECtlCredits))->TextLength();
\r
242 static_cast<CEikGlobalTextEditor*>(Control(ECtlCredits))->Text()->InsertL(iLength, CEditableText::ELineBreak);
\r
244 CleanupStack::PopAndDestroy(desArray);
\r
247 void CCreditsDialog::PostLayoutDynInitL()
\r
249 static_cast<CEikGlobalTextEditor*>(Control(ECtlCredits))->CreateScrollBarFrameL();
\r
250 static_cast<CEikGlobalTextEditor*>(Control(ECtlCredits))->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto);
\r
253 TKeyResponse CCreditsDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
\r
255 if (aType == EEventKey)
\r
257 if (aKeyEvent.iCode == EQuartzKeyTwoWayDown)
\r
259 static_cast<CEikGlobalTextEditor*>(Control(ECtlCredits))->MoveDisplayL(TCursorPosition::EFLineDown);
\r
260 static_cast<CEikGlobalTextEditor*>(Control(ECtlCredits))->UpdateScrollBarsL();
\r
261 return EKeyWasConsumed;
\r
263 else if (aKeyEvent.iCode == EQuartzKeyTwoWayUp)
\r
265 static_cast<CEikGlobalTextEditor*>(Control(ECtlCredits))->MoveDisplayL(TCursorPosition::EFLineUp);
\r
266 static_cast<CEikGlobalTextEditor*>(Control(ECtlCredits))->UpdateScrollBarsL();
\r
267 return EKeyWasConsumed;
\r
270 return CEikDialog::OfferKeyEventL(aKeyEvent, aType);
\r
274 /*************************************************************
\r
278 **************************************************************/
\r
280 CDebugDialog::CDebugDialog(char *t)
\r
282 Mem::Copy(iText, t, 1024);
\r
286 void CDebugDialog::PreLayoutDynInitL()
\r
288 char *p = iText, *line = iText;
\r
291 CEikGlobalTextEditor *editor = static_cast<CEikGlobalTextEditor*>(Control(ECtlDebugEdit));
\r
294 while(*p && *p != '\r' && *p != '\n') p++;
\r
297 TPtrC8 ptr((TUint8*) line);
\r
299 editor->Text()->InsertL(editor->TextLength(), tbuf);
\r
300 editor->Text()->InsertL(editor->TextLength(), CEditableText::ELineBreak);
\r
305 void CDebugDialog::PostLayoutDynInitL()
\r
307 static_cast<CEikGlobalTextEditor*>(Control(ECtlDebugEdit))->CreateScrollBarFrameL();
\r
308 static_cast<CEikGlobalTextEditor*>(Control(ECtlDebugEdit))->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto);
\r
311 TKeyResponse CDebugDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
\r
313 if (aType == EEventKey)
\r
315 if (aKeyEvent.iCode == EQuartzKeyTwoWayDown)
\r
317 static_cast<CEikGlobalTextEditor*>(Control(ECtlDebugEdit))->MoveDisplayL(TCursorPosition::EFLineDown);
\r
318 static_cast<CEikGlobalTextEditor*>(Control(ECtlDebugEdit))->UpdateScrollBarsL();
\r
319 return EKeyWasConsumed;
\r
321 else if (aKeyEvent.iCode == EQuartzKeyTwoWayUp)
\r
323 static_cast<CEikGlobalTextEditor*>(Control(ECtlDebugEdit))->MoveDisplayL(TCursorPosition::EFLineUp);
\r
324 static_cast<CEikGlobalTextEditor*>(Control(ECtlDebugEdit))->UpdateScrollBarsL();
\r
325 return EKeyWasConsumed;
\r
328 return CEikDialog::OfferKeyEventL(aKeyEvent, aType);
\r
332 /************************************************
\r
334 * SimpleTextInfoDialog
\r
336 ************************************************/
\r
339 CSimpleTextInfoDialog::CSimpleTextInfoDialog(TInt aTextIdOne, TInt aRichTextCtlIdOne, TInt aTextIdTwo, TInt aRichTextCtlIdTwo, TBool aSimpleTextResIdOneIsArray, TBool aSimpleTextResIdTwoIsArray)
\r
340 : iSimpleTextResIdOne(aTextIdOne),
\r
341 iSimpleTextResIdTwo(aTextIdTwo),
\r
342 iRichTextCtlIdOne(aRichTextCtlIdOne),
\r
343 iRichTextCtlIdTwo(aRichTextCtlIdTwo),
\r
344 iSimpleTextResIdOneIsArray(aSimpleTextResIdOneIsArray),
\r
345 iSimpleTextResIdTwoIsArray(aSimpleTextResIdTwoIsArray),
\r
346 iSetDialogBackground(ETrue)
\r
350 void CSimpleTextInfoDialog::PreLayoutDynInitL()
\r
352 CEikRichTextEditor* richTextEditor;
\r
354 if (iRichTextCtlIdOne != -1)
\r
356 richTextEditor=STATIC_CAST(CEikRichTextEditor*, Control(iRichTextCtlIdOne));
\r
357 PreLayoutDynInitRichTextL(*richTextEditor, iRichTextCtlIdOne, iSimpleTextResIdOne);
\r
360 if (iRichTextCtlIdTwo != -1)
\r
362 richTextEditor=STATIC_CAST(CEikRichTextEditor*, Control(iRichTextCtlIdTwo));
\r
363 richTextEditor->Border().SetType(ENone);
\r
364 PreLayoutDynInitRichTextL(*richTextEditor, iRichTextCtlIdTwo, iSimpleTextResIdTwo);
\r
369 void CSimpleTextInfoDialog::PreLayoutDynInitRichTextL(CEikRichTextEditor& aRichTextEditor, TInt aRichTextCtlId, TInt aSimpleTextResId)
\r
371 iEikonEnv->BusyMsgL(_L("Opening"));
\r
372 aRichTextEditor.SetEdwinSizeObserver(this);
\r
373 if (iSetDialogBackground)
\r
374 aRichTextEditor.SetBackgroundColorL(iEikonEnv->Color(EColorDialogBackground));
\r
375 aRichTextEditor.SetSize(aRichTextEditor.Size()); // Set the size of the edwin
\r
377 // no scrollbars for us
\r
378 aRichTextEditor.CreateScrollBarFrameL(); // Create the scrollbars
\r
379 aRichTextEditor.ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, iWantVertScrollbar ? CEikScrollBarFrame::EAuto: CEikScrollBarFrame::EOff);
\r
381 ShowTextL(*aRichTextEditor.RichText(), aRichTextCtlId, aSimpleTextResId);
\r
383 aRichTextEditor.UpdateAllFieldsL(); // Updates all the fields in the document
\r
385 aRichTextEditor.UpdateScrollBarsL();
\r
389 void CSimpleTextInfoDialog::PostLayoutDynInitL()
\r
392 iEikonEnv->BusyMsgCancel();
\r
395 TBool CSimpleTextInfoDialog::HandleEdwinSizeEventL(CEikEdwin* aEdwin, TEdwinSizeEvent aEventType, TSize aDesirableEdwinSize)
\r
397 if ((aEventType == EEventSizeChanging))
\r
398 aEdwin->SetSize(aDesirableEdwinSize);
\r
402 void CSimpleTextInfoDialog::ShowTextL(CRichText& aRichText, TInt /*aRichTextCtlId*/, TInt aResId)
\r
406 if ( ((aResId == iSimpleTextResIdOne) && (iSimpleTextResIdOneIsArray)) ||
\r
407 ((aResId == iSimpleTextResIdTwo) && (iSimpleTextResIdTwoIsArray))
\r
410 CDesCArrayFlat* desArray = CEikonEnv::Static()->ReadDesCArrayResourceL(aResId);
\r
411 CleanupStack::PushL(desArray);
\r
413 CSimpleTextFormatParser* parser = CSimpleTextFormatParser::NewLC();
\r
415 TInt count = desArray->Count();
\r
416 for (TInt i=0 ;i<count ; i++)
\r
417 parser->ParseL(desArray->operator[](i), aRichText);
\r
419 CleanupStack::PopAndDestroy(parser);
\r
420 CleanupStack::PopAndDestroy(desArray);
\r
424 HBufC* text = CEikonEnv::Static()->AllocReadResourceLC(aResId);
\r
425 ShowSimpleTextL(*text, aRichText);
\r
426 CleanupStack::PopAndDestroy(text);
\r
431 void CSimpleTextInfoDialog::ShowSimpleTextL(const TDesC& aSimpleText, CRichText& aRichText)
\r
433 CSimpleTextFormatParser* parser = CSimpleTextFormatParser::NewLC();
\r
434 parser->ParseL(aSimpleText, aRichText);
\r
436 CleanupStack::PopAndDestroy(parser);
\r
441 /************************************************
\r
445 ************************************************/
\r
447 CAboutDialog::CAboutDialog() : CSimpleTextInfoDialog(-1, ECtlAboutVersion, R_SIMPLE_TEXT_ABOUT_LINKS, ECtlAboutLinks)
\r
451 void CAboutDialog::ShowTextL(CRichText& aRichText, TInt aRichTextCtlId, TInt aResId)
\r
453 if (aRichTextCtlId == ECtlAboutLinks)
\r
454 CSimpleTextInfoDialog::ShowTextL(aRichText, aRichTextCtlId, aResId);
\r
457 TBuf<16> versionText;
\r
460 #if (KPicoBuildNumber != 0)
\r
461 versionText.Format(_L("%d.%d%d"), KPicoMajorVersionNumber, KPicoMinorVersionNumber, KPicoBuildNumber);
\r
463 versionText.Format(_L("%d.%d"), KPicoMajorVersionNumber, KPicoMinorVersionNumber);
\r
466 HBufC* aboutFormat = CEikonEnv::Static()->AllocReadResourceLC(R_SIMPLE_TEXT_ABOUT);
\r
467 text.Format(*aboutFormat, &versionText);
\r
469 ShowSimpleTextL(text, aRichText);
\r
471 CleanupStack::PopAndDestroy(aboutFormat);
\r