Beispiel #1
0
// TODO: make those on-demand only to save memory
void PediaMainForm::prepareHowToRegister()
{
    DefinitionModel* model = new_nt DefinitionModel();   
    if (NULL == model)   
    {   
       //application().alert(notEnoughMemoryAlert);   
       return;   
    }
    Definition::Elements_t& elems = model->elements; 
    setTitle("iPedia - How to register");
    TextElement* text;

    FontEffects fxBold;
    fxBold.setWeight(FontEffects::weightBold);

    elems.push_back(text=new TextElement("Unregistered version of iPedia limits how many articles can be viewed in one day (there are no limits on random articles.)"));
    elems.push_back(new LineBreakElement());

    elems.push_back(text=new TextElement("In order to register iPedia you need to purchase registration code at "));

// those 3 #defines should be mutually exclusive
#ifdef PALMGEAR
    elems.push_back(text=new TextElement("palmgear.com?67708"));
#endif

#ifdef HANDANGO
    elems.push_back(text=new TextElement("handango.com/purchase, product id: 128991"));
#endif

#ifdef ARSLEXIS_VERSION
    elems.push_back(text=new TextElement("our website "));
    elems.push_back(text=new TextElement("http://www.arslexis.com"));
    text->setHyperlink("http://www.arslexis.com/pda/palm.html", hyperlinkExternal);
#endif
    elems.push_back(new LineBreakElement());

    elems.push_back(text=new TextElement("After obtaining registration code use menu item 'Options/Register' (or "));
    elems.push_back(text=new TextElement("click here"));
    // url doesn't really matter, it's only to establish a hotspot
    text->setHyperlink("", hyperlinkTerm);
    text->setActionCallback( registerActionCallback, static_cast<void*>(this) );
    elems.push_back(text=new TextElement(") to enter registration code. "));

    elems.push_back(text=new TextElement("Go back to main screen."));
    text->setJustification(DefinitionElement::justifyLeft);
    // url doesn't really matter, it's only to establish a hotspot
    text->setHyperlink("", hyperlinkTerm);
    text->setActionCallback(aboutActionCallback, this);

    //infoRenderer_.replaceElements(elems);
    infoRenderer_.setModel(model, Definition::ownModel);
}
Beispiel #2
0
void PediaMainForm::prepareWikipedia()
{
    DefinitionModel* model = new_nt DefinitionModel();   
    if (NULL == model)   
    {   
       //application().alert(notEnoughMemoryAlert);   
       return;   
    }
    Definition::Elements_t& elems = model->elements; 
    setTitle("iPedia - Wikipedia");
    TextElement* text;
    FontEffects fxBold;
    fxBold.setWeight(FontEffects::weightBold);

    elems.push_back(text=new TextElement("All the articles in iPedia come from WikiPedia project and are licensed under "));
    elems.push_back(text=new TextElement("GNU Free Documentation License"));
    text->setHyperlink("http://www.gnu.org/copyleft/fdl.html", hyperlinkExternal);
    elems.push_back(text=new TextElement("."));
    elems.push_back(new LineBreakElement());

    elems.push_back(text=new TextElement("To find out more about WikiPedia project, visit "));
    elems.push_back(text=new TextElement("wikipedia.org"));
    text->setHyperlink("http://www.wikipedia.org", hyperlinkExternal);
    elems.push_back(text=new TextElement(" website. "));
    elems.push_back(new LineBreakElement());

    elems.push_back(text=new TextElement("Go back to main screen."));
    text->setJustification(DefinitionElement::justifyLeft);
    // url doesn't really matter, it's only to establish a hotspot
    text->setHyperlink("", hyperlinkTerm);
    text->setActionCallback(aboutActionCallback, this);

    //infoRenderer_.replaceElements(elems);
    infoRenderer_.setModel(model, Definition::ownModel);
}    
Beispiel #3
0
// TODO: make those on-demand only to save memory
void PediaMainForm::prepareTutorial()
{
    DefinitionModel* model = new_nt DefinitionModel();   
    if (NULL == model)   
    {   
       //application().alert(notEnoughMemoryAlert);   
       return;   
    }
    Definition::Elements_t& elems = model->elements; 
    setTitle("iPedia - Tutorial");
    TextElement* text;

    FontEffects fxBold;
    fxBold.setWeight(FontEffects::weightBold);

    elems.push_back(text=new TextElement("Go back to main screen."));
    text->setJustification(DefinitionElement::justifyLeft);
    // url doesn't really matter, it's only to establish a hotspot
    text->setHyperlink("", hyperlinkTerm);
    text->setActionCallback( aboutActionCallback, static_cast<void*>(this) );
    elems.push_back(new LineBreakElement(4,3));

    elems.push_back(text=new TextElement("iPedia is a wireless encyclopedia. Use it to get information and facts on just about anything."));
    elems.push_back(new LineBreakElement(4,3));

    elems.push_back(text=new TextElement("Finding an encyclopedia article."));
//    text->setEffects(fxBold);
    elems.push_back(text=new TextElement(" Let's assume you want to read an encyclopedia article on Seattle. Enter 'Seattle' in the text field at the bottom of the screen and press 'Search' (or center button on Treo's 5-way navigator)."));
    text->setJustification(DefinitionElement::justifyLeft);
    elems.push_back(new LineBreakElement(4,3));

    elems.push_back(text=new TextElement("Finding all articles with a given word."));
//    text->setEffects(fxBold);
    elems.push_back(text=new TextElement(" Let's assume you want to find all articles that mention Seattle. Enter 'Seattle' in the text field and use 'Main/Extended search' menu item. In response you'll receive a list of articles that contain word 'Seattle'."));
    text->setJustification(DefinitionElement::justifyLeft);
    elems.push_back(new LineBreakElement(4,3));

    elems.push_back(text=new TextElement("Refining the search."));
//    text->setEffects(fxBold);
    elems.push_back(text=new TextElement(" If there are too many results, you can refine (narrow) the search results by adding additional terms e.g. type 'museum' and press 'Refine' button. You'll get a smaller list of articles that contain both 'Seattle' and 'museum'."));
    text->setJustification(DefinitionElement::justifyLeft);
    elems.push_back(new LineBreakElement(4,3));

    elems.push_back(text=new TextElement("Results of last extended search."));
//    text->setEffects(fxBold);
    elems.push_back(text=new TextElement(" At any time you can get a list of results from last extended search by using menu item 'Main/Extended search results'."));
    text->setJustification(DefinitionElement::justifyLeft);
    elems.push_back(new LineBreakElement(4,3));

    elems.push_back(text=new TextElement("Random article."));
//    text->setEffects(fxBold);
    elems.push_back(text=new TextElement(" You can use menu 'Main/Random article' (or "));
    text->setJustification(DefinitionElement::justifyLeft);
    elems.push_back(text=new TextElement("click here"));
    text->setJustification(DefinitionElement::justifyLeft);
    // url doesn't really matter, it's only to establish a hotspot
    text->setHyperlink("", hyperlinkTerm);
    text->setActionCallback( randomArticleActionCallback, static_cast<void*>(this) );
    elems.push_back(text=new TextElement(") to get a random article."));
    text->setJustification(DefinitionElement::justifyLeft);
    elems.push_back(new LineBreakElement(4,3));

    elems.push_back(text=new TextElement("More information."));
//    text->setEffects(fxBold);
    elems.push_back(text=new TextElement(" Please visit our website "));
    text->setJustification(DefinitionElement::justifyLeft);

    elems.push_back(text=new TextElement("arslexis.com"));
    text->setHyperlink("http://www.arslexis.com/pda/palm.html", hyperlinkExternal);
    text->setJustification(DefinitionElement::justifyLeft);

    elems.push_back(text=new TextElement(" for more information about iPedia."));
    text->setJustification(DefinitionElement::justifyLeft);
    elems.push_back(new LineBreakElement(4,3));

    elems.push_back(text=new TextElement("Go back to main screen."));
    text->setJustification(DefinitionElement::justifyLeft);
    // url doesn't really matter, it's only to establish a hotspot
    text->setHyperlink("", hyperlinkTerm);
    text->setActionCallback(aboutActionCallback, this);

    //infoRenderer_.replaceElements(elems);
    infoRenderer_.setModel(model, Definition::ownModel);
}
Beispiel #4
0
void PediaMainForm::prepareAbout()
{
    DefinitionModel* model = new_nt DefinitionModel();   
    if (NULL == model)   
    {   
       //application().alert(notEnoughMemoryAlert);   
       return;   
    }   
     
    Definition::Elements_t& elems = model->elements; 

    TextElement *  text;
    TextElement *  articleCountElement;
    setTitle("iPedia");

    FontEffects fxBold;
    fxBold.setWeight(FontEffects::weightBold);

    elems.push_back(new LineBreakElement(1,10));

    elems.push_back(text=new TextElement("ArsLexis iPedia"));
    text->setJustification(DefinitionElement::justifyCenter);
    text->setStyle(StyleGetStaticStyle(styleNameHeader));

    elems.push_back(new LineBreakElement(1,3));

    const char* version="Ver " appVersion
#ifdef INTERNAL_BUILD
    " (internal)"
#endif
/*
#ifdef DEBUG
        " (debug)"
#endif*/
    ;
    elems.push_back(text=new TextElement(version));
    text->setJustification(DefinitionElement::justifyCenter);
    elems.push_back(new LineBreakElement(1,4));

#ifdef UNLOCKED
    elems.push_back(text=new TextElement("Registered PalmSource version"));
    text->setJustification(DefinitionElement::justifyCenter);
    elems.push_back(new LineBreakElement(1,2));
#else
    if (app().preferences().regCode.empty())
    {
        elems.push_back(text=new TextElement("Unregistered ("));
        text->setJustification(DefinitionElement::justifyCenter);
        elems.push_back(text=new TextElement("how to register"));
        text->setJustification(DefinitionElement::justifyCenter);
        // url doesn't really matter, it's only to establish a hotspot
        text->setHyperlink("", hyperlinkTerm);
        text->setActionCallback( unregisteredActionCallback, static_cast<void*>(this) );
        elems.push_back(text=new TextElement(")"));
        text->setJustification(DefinitionElement::justifyCenter);
        elems.push_back(new LineBreakElement(1,2));
    }
    else
    {
        elems.push_back(text=new TextElement("Registered"));
        text->setJustification(DefinitionElement::justifyCenter);
        elems.push_back(new LineBreakElement(1,2));
    }
#endif

    elems.push_back(text=new TextElement("Software \251 "));
    text->setJustification(DefinitionElement::justifyCenter);

    elems.push_back(text=new TextElement("ArsLexis"));
    text->setJustification(DefinitionElement::justifyCenter);
    text->setHyperlink("http://www.arslexis.com/pda/palm.html", hyperlinkExternal);

    elems.push_back(new LineBreakElement(1,4));
    elems.push_back(text=new TextElement("Data \251 "));
    text->setJustification(DefinitionElement::justifyCenter);

    elems.push_back(text=new TextElement("WikiPedia"));
    text->setJustification(DefinitionElement::justifyCenter);
    // url doesn't really matter, it's only to establish a hotspot
    text->setHyperlink("", hyperlinkTerm);
    text->setActionCallback(wikipediaActionCallback, static_cast<void*>(this) );

    elems.push_back(new LineBreakElement(1,2));

    articleCountElement = new TextElement(" ");

    if (-1 != app().preferences().articleCount)    
    {
        prepareArticleCountEl(articleCountElement, app().preferences().articleCount, app().preferences().databaseTime);
    }

    elems.push_back(articleCountElement);
    articleCountElement->setJustification(DefinitionElement::justifyCenter);

    elems.push_back(new LineBreakElement(1, 2));
    elems.push_back(text=new TextElement("Using iPedia: "));
    text->setJustification(DefinitionElement::justifyLeft);

    elems.push_back(text=new TextElement("tutorial"));
    text->setJustification(DefinitionElement::justifyLeft);
    // url doesn't really matter, it's only to establish a hotspot
    text->setHyperlink("", hyperlinkTerm);
    text->setActionCallback(tutorialActionCallback, this);

    //infoRenderer_.replaceElements(elems);
    infoRenderer_.setModel(model, Definition::ownModel);
}