void eEventDisplay::init_eEventDisplay(const ePtrList<EITEvent>* e)
{
	eventlist=0;
	events=0;

	scrollbar = new eProgress(this);
	scrollbar->setName("scrollbar");
	scrollbar->setStart(0);
	scrollbar->setPerc(100);

	descr = new eWidget(this);
	descr->setName("epg_description");

	eventTime = new eLabel(this);
	eventTime->setName("time");

	eventDate = new eLabel(this);
	eventDate->setName("date");

	channel = new eLabel(this);
	channel->setName("channel");

	timer_icon = new eLabel(this);
	timer_icon->setName("timer_icon");

	eSkin *skin=eSkin::getActive();
	if (skin->build(this, "eventview"))
		eFatal("skin load of \"eventview\" failed");

	long_description=new eLabel(descr);
	long_description->setFlags(RS_WRAP);

	// try to recalc long description label... ( no broken text lines.. )
	float lineheight=fontRenderClass::getInstance()->getLineHeight( long_description->getFont() );
	int lines = (int)(descr->getSize().height() / lineheight);
	pageHeight = (int)(lines * lineheight);
	descr->resize( eSize( descr->getSize().width(), pageHeight+(int)(lineheight/6)));
	long_description->resize(eSize(descr->getSize().width(), pageHeight*16));

#ifndef DISABLE_FILE
	addActionToHelpList( &i_epgSelectorActions->addDVRTimerEvent );
#endif
#ifndef DISABLE_NETWORK
	addActionToHelpList( &i_epgSelectorActions->addNGRABTimerEvent );
#endif
	addActionToHelpList( &i_epgSelectorActions->addSwitchTimerEvent );
	addActionToHelpList( &i_epgSelectorActions->removeTimerEvent );
	addActionToHelpList( &i_enigmaEventViewActions->close );

	if (e)
		setList(*e);
	else if (evt)
		setEvent(evt);
	addActionMap( &i_enigmaEventViewActions->map );
	addActionMap( &i_epgSelectorActions->map );
	
	setHelpID(11);
}
void enigmaVCR::init_enigmaVCR()
{
	if ( !instance )
		instance = this;
	else
		eFatal("create more than one enigmaVCR instances");
	addActionMap(&i_enigmaVCRActions->map);
}
Beispiel #3
0
void eListBoxBase::init_eListBoxBase()
{
	scrollbar = new eProgress(this);
	scrollbar->setDirection(1);
	childs.setAutoDelete(false);	// machen wir selber
	addActionMap(&i_cursorActions->map);
	addActionMap(&i_listActions->map);
	if ( !colorActiveB )
		colorActiveB=eSkin::getActive()->queryScheme("global.selected.background");
	if ( !colorActiveF )
		colorActiveF=eSkin::getActive()->queryScheme("global.selected.foreground");
	gColor col = eSkin::getActive()->queryScheme("listbox.normal.background");
	if (col)
		backgroundColor=col;
	col = eSkin::getActive()->queryScheme("listbox.normal.foreground");
	if (col)
			foregroundColor=col;
}
Beispiel #4
0
void eWidget::init_eWidget()
{
	if (takefocus)
		getTLW()->focusList()->push_back(this);

	if (parent)
		parent->childlist.push_back(this);

	addActionMap(&i_cursorActions->map);
}
Beispiel #5
0
void eTextInputField::init_eTextInputField()
{
	if ( eConfig::getInstance()->getKey("/ezap/rc/TextInputField/nextCharTimeout", nextCharTimeout ) )
		nextCharTimeout=0;
	CONNECT( nextCharTimer.timeout, eTextInputField::nextChar );
	addActionMap(&i_numberActions->map);
	addActionMap(&i_texteditActions->map);
	flags=0;
	align=eTextPara::dirLeft;
	table=0;
	char *language=0;
	if (!eConfig::getInstance()->getKey("/elitedvb/language", language))
	{
		if (strstr(language,"ru_RU"))
			table=5;
		free(language);
	}
	if ( helpwidget )
		editHelpText=_("press ok to save");
	updateHelpWidget();
}
Beispiel #6
0
void eTransponderEditWindow::init_eTransponderEditWindow()
{
    addActionMap(&i_TransponderEditWindowActions->map);
    sat = new eButton(this);
    sat->setName("sat");
    CONNECT(sat->selected, eTransponderEditWindow::satPressed);
    add = new eButton(this);
    add->setName("add");
    CONNECT(add->selected, eTransponderEditWindow::addPressed);
    edit = new eButton(this);
    edit->setName("edit");
    CONNECT(edit->selected, eTransponderEditWindow::editPressed);
    remove = new eButton(this);
    remove->setName("remove");
    CONNECT(remove->selected, eTransponderEditWindow::removePressed);
    satellites = new eListBox<eListBoxEntryText>( this, 0, 0 );
    satellites->setName("satlist");
    transponders = new eListBox<eListBoxEntryTransponder>( this, 0, 0 );
    transponders->setName("transponderlist");
    transponders->FakeFocus( 0 );
    satellites->FakeFocus( 1 );
    if ( eSkin::getActive()->build( this, "TransponderWindow") )
        eFatal("eTransponderEditWindow build failed");

    eDVBServiceController *sapi=eDVB::getInstance()->getServiceAPI();
    eTransponder *tp=0;

    if (sapi && sapi->transponder)
        tp = sapi->transponder;

    eListBoxEntryText *sel=0;

    if( !eTransponderList::getInstance()->reloadNetworks() )
    {
        for ( std::list<tpPacket>::iterator i(eTransponderList::getInstance()->getNetworks().begin()); i != eTransponderList::getInstance()->getNetworks().end(); ++i)
            if ( tp && i->orbital_position == tp->satellite.orbital_position )
                sel = new eListBoxEntryText(satellites, i->name, (void*) &(*i));
            else
                new eListBoxEntryText(satellites, i->name, (void*) &(*i));
    }
    CONNECT(satellites->selchanged, eTransponderEditWindow::satSelChanged );

    if ( sel )
        satellites->setCurrent(sel);
    else
        satellites->setCurrent(0);

    CONNECT( eWidget::focusChanged, eTransponderEditWindow::focusChanged );
    satSelChanged( satellites->getCurrent() );
    setHelpID(64);
}
Beispiel #7
0
void PluginOffsetScreen::init_PluginOffsetScreen()
{
	foreColor = eSkin::getActive()->queryColor("eWindow.titleBarFont");
	setForegroundColor( foreColor );
	move(ePoint(0,0));
	resize(eSize(768,576));
	descr = new eLabel( this );
	descr->setFlags( eLabel::flagVCenter|RS_WRAP );
	descr->setForegroundColor( foreColor );
	descr->resize(eSize(568,300));
	descr->move(ePoint(100,100));
	descr->setText(_("here you can center the tuxtxt rectangle...\npress red to select the left top edge\npress green to select the right bottom edge\nuse the cursor keys to move the selected edges"));
	eSize ext = descr->getExtend();
	ext+=eSize(8,4);  // the given Size of the Text is okay... but the renderer sucks...
	descr->resize( ext );
	descr->move( ePoint( (width()/2)-(ext.width()/2) , (height()/2)-(ext.height()/2) ) );
	descr->show();
	addActionMap(&i_PluginOffsetActions->map);
	addActionMap(&i_cursorActions->map);
	addActionToHelpList( &i_PluginOffsetActions->leftTop );
	addActionToHelpList( &i_PluginOffsetActions->rightBottom );
	setHelpID(96);
}
Beispiel #8
0
void eButton::init_eButton()
{
	align=eTextPara::dirCenter;
	flags |= eLabel::flagVCenter;
	addActionMap(&i_cursorActions->map);
	if ( !focusF )
		focusF=eSkin::getActive()->queryScheme("global.selected.foreground");
	if ( !focusB )
		focusB=eSkin::getActive()->queryScheme("global.selected.background");
	if ( !normalF )
		normalF=eSkin::getActive()->queryScheme("global.normal.foreground");
	if ( !normalB )
		normalB=eSkin::getActive()->queryScheme("global.normal.background");
	setBackgroundColor(normalB);
	setForegroundColor(normalF);
}
Beispiel #9
0
void eWidget::takeFocus()
{
		// desktop shouldnt receive global focus
	ASSERT (parent);
		// childs shouldnt receive global focus
	ASSERT (!parent->parent);

	if (!have_focus)
	{
		oldTLfocus=currentFocus;
		currentFocus=this;
		/*emit*/ globalFocusChanged(currentFocus);
/*		if (oldTLfocus)
		{
			eDebug("focus problem");
			eFatal("da hat %s den focus und %s will ihn haben", oldTLfocus->getText().c_str(), getText().c_str());
		} */
		addActionMap(&i_focusActions->map);
	}
	++have_focus;
}
Beispiel #10
0
void eListBoxBase::setFlags(int _flags)	
{
	flags |= _flags;	
	if (_flags == flagHasShortcuts)
		addActionMap(&i_shortcutActions->map);
}
Beispiel #11
0
eListBoxBaseExt::eListBoxBaseExt(eWidget* parent, const eWidget* descr, int takefocus, int item_height, const char *deco)
	:eListBoxBase(parent, descr, takefocus, item_height, deco), browseTimer(eApp)
{
	CONNECT(browseTimer.timeout, eListBoxBaseExt::browseTimeout);
	addActionMap(&i_numberActions->map);
}
void eMainMenu::init_eMainMenu()
{
	simpleMainmenu=0;
	eConfig::getInstance()->getKey("/ezap/osd/simpleMainMenu", simpleMainmenu);

	if ( !simpleMainmenu )
	{
		addActionMap(&i_mainmenuActions->map);
		addActionMap(&i_cursorActions->map);
		addActionMap(&i_shortcutActions->map);
		eLabel *background=new eLabel(this);
		background->setName("background");

		label[0]=new eLabel(this);
		label[0]->setName("l3");
		label[1]=new eLabel(this);
		label[1]->setName("l2");
		label[2]=new eLabel(this);
		label[2]->setName("l1");
		label[3]=new eLabel(this);
		label[3]->setName("m");
		label[4]=new eLabel(this);
		label[4]->setName("r1");
		label[5]=new eLabel(this);
		label[5]->setName("r2");
		label[6]=new eLabel(this);
		label[6]->setName("r3");

		description=new eLabel(this);
		description->setName("description");

		if (eSkin::getActive()->build(this, "eZapMainMenu"))
			eFatal("unable to load main menu");

			char *pixmap_name[]={
		"tv",
		"radio",
#ifndef DISABLE_FILE
		"file",
#endif
		"info",
#ifndef DISABLE_FILE
		"shutdown",
#endif
		"setup",
#ifndef DISABLE_FILE
		"games",
#endif
		"timer",
		"scart"
		};

		int count = MENU_ENTRIES;
		if (!eSystemInfo::getInstance()->hasScartSwitch())
			--count;
		for (int i=0; i<count; i++)
		{
			pixmaps[i][0]=eSkin::getActive()->queryImage(eString("mainmenu.") + eString(pixmap_name[i]) );
			pixmaps[i][1]=eSkin::getActive()->queryImage(eString("mainmenu.") + eString(pixmap_name[i]) + ".sel" );
			if (!pixmaps[i][0])
				eFatal("error, mainmenu bug, mainmenu.%s not defined", pixmap_name[i]);
			if (!pixmaps[i][1])
				eFatal("error, mainmenu bug, mainmenu.%s.sel not defined", pixmap_name[i]);
			pixmaps[i][0]->uncompressdata();
			pixmaps[i][1]->uncompressdata();
		}

		setActive(active=eZapMain::getInstance()->getMode());
	}
	else
	{
		CONNECT(wndShowTimer.timeout, eMainMenu::showWindow);
		wnd.cmove(ePoint(180, 115));
		int entry=0;
		int count = MENU_ENTRIES;
		for (int i=0; i<count; i++)
		{
			pixmaps[i][0]=NULL;
			pixmaps[i][1]=NULL;
		}
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("TV mode"), eString().sprintf("(%d) %s", ++entry, _("TV mode")) ))->selected, eMainMenu::sel_tv);
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Radio mode"), eString().sprintf("(%d) %s", ++entry, _("Radio mode")) ))->selected, eMainMenu::sel_radio);
#ifndef DISABLE_FILE
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("File mode"), eString().sprintf("(%d) %s", ++entry, _("File mode")) ))->selected, eMainMenu::sel_file);
		if ( eSystemInfo::getInstance()->hasScartSwitch() )
			CONNECT((new eListBoxEntryMenu(wnd.getList(), _("VCR"), eString().sprintf("(%d) %s", ++entry, _("VCR")) ))->selected, eMainMenu::sel_vcr);
		new eListBoxEntryMenuSeparator(wnd.getList(), eSkin::getActive()->queryImage("listbox.separator"), 0, true );
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Timer"), eString().sprintf("(%d) %s", ++entry, _("Timer")) ))->selected, eMainMenu::sel_timer);
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Setup"), eString().sprintf("(%d) %s", ++entry, _("Setup")) ))->selected, eMainMenu::sel_setup);
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Games"), eString().sprintf("(%d) %s", ++entry, _("Games")) ))->selected, eMainMenu::sel_plugins);
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Information"), eString().sprintf("(%d) %s", ++entry, _("Information")) ))->selected, eMainMenu::sel_info);
		new eListBoxEntryMenuSeparator(wnd.getList(), eSkin::getActive()->queryImage("listbox.separator"), 0, true );
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Shutdown"), eString().sprintf("(%d) %s", ++entry, _("Shutdown")) ))->selected, eMainMenu::sel_quit);
#else
		if ( eSystemInfo::getInstance()->hasScartSwitch() )
			CONNECT((new eListBoxEntryMenu(wnd.getList(), _("VCR"), eString().sprintf("(%d) %s", ++entry, _("VCR")) ))->selected, eMainMenu::sel_vcr);
		new eListBoxEntryMenuSeparator(wnd.getList(), eSkin::getActive()->queryImage("listbox.separator"), 0, true );
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Timer"), eString().sprintf("(%d) %s", ++entry, _("Timer")) ))->selected, eMainMenu::sel_timer);
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Setup"), eString().sprintf("(%d) %s", ++entry, _("Setup")) ))->selected, eMainMenu::sel_setup);
		new eListBoxEntryMenuSeparator(wnd.getList(), eSkin::getActive()->queryImage("listbox.separator"), 0, true );
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Information"), eString().sprintf("(%d) %s", ++entry, _("Information")) ))->selected, eMainMenu::sel_info);
#endif
	}
	setHelpID(10);
}
Beispiel #13
0
void eHelpWindow::init_eHelpWindow(ePtrList<eAction> &parseActionHelpList, int helpID)
{
	int xpos=60, ypos=0, labelheight, imgheight;

	scrollbar = CreateSkinnedProgress("scrollbar",0,100);

	visible = new eWidget(this);
	visible->setName("visible");

	BuildSkin("eHelpWindow");

	scrollbox = new eWidget(visible);
	scrollbox->move(ePoint(0, 0));
	scrollbox->resize(eSize(visible->width(), visible->height()*8));

	const std::set<eString> &styles=eActionMapList::getInstance()->getCurrentStyles();

	lastEntry=0;
	entryBeg[lastEntry++]=0;
	int pageend=visible->height();

	for ( ePtrList<eAction>::iterator it( parseActionHelpList.begin() ); it != parseActionHelpList.end() ; it++ )
	{
		std::map< eString, keylist >::iterator b;
		
		for (std::set<eString>::const_iterator si(styles.begin()); si != styles.end(); ++si)
		{
			b=it->keys.find(*si);
			if (b == it->keys.end())
				continue;

			keylist &keys = b->second;
			for ( keylist::iterator i( keys.begin() ); i != keys.end() ; i++ )
			{
				imgheight=0;
				if ( strstr( i->producer->getDescription(), eSystemInfo::getInstance()->getHelpStr() ) )
				{
					if (i->picture)
					{
						gPixmap *image=eSkin::getActive()->queryImage(i->picture);

						if (image)
						{
							label = new eLabel(scrollbox);
							label->setFlags(eLabel::flagVCenter);
							label->move(ePoint(0, ypos));
							label->resize(eSize(xpos,image->y));
							label->setBlitFlags(BF_ALPHATEST);
							label->setPixmap(image);
							label->setPixmapPosition(ePoint((xpos-10)/2-image->x/2, 0));
						}
					}

					label = new eLabel(scrollbox);
					label->setFlags(eLabel::flagVCenter);
					label->setFlags(RS_WRAP);
					label->move(ePoint(xpos, ypos));
					label->resize(eSize(visible->width()-xpos-20, 200));
							// since they are inited before language is set,
							// call gettext again.
					label->setText(gettext(it->getDescription()));
					labelheight=label->getExtend().height();
					label->resize(eSize(visible->width()-xpos-20, labelheight));

					ypos+=(labelheight>imgheight?labelheight:imgheight)+20;
					if ( ypos-20 > pageend )
					{
						pageend=ypos-(labelheight>imgheight?labelheight:imgheight)-20;
						entryBeg[lastEntry++]=pageend;
						pageend+=visible->height();
					}
					break;  // add only once :)
				}
			}
		}
	}

	if (helpID)
	{
		eString helptext=loadHelpText(helpID);

		label = new eLabel(scrollbox);
		label->setFlags(eLabel::flagVCenter);
		label->setFlags(RS_WRAP);
		label->move(ePoint(0, ypos));
		label->resize(eSize(visible->width(), 200));
		label->setText(helptext);
		labelheight = label->getExtend().height();
		label->resize(eSize(visible->width(), labelheight));
		int tmp = ypos+labelheight;
		while ( tmp > pageend )
		{
			entryBeg[lastEntry++]=ypos;
			ypos+=visible->height();
			pageend=ypos;
		}
	}

	--lastEntry;
	cur = 0;
	doscroll=ypos>visible->height();

	if (!doscroll)
		scrollbar->hide();
	else
	  updateScrollbar();
	  
	addActionMap(&i_helpwindowActions->map);
}