I'm writing a plugin and would like to display some OSD output in columns like many other plugins and vdr itself does. But special characters like '\t' for a tabulator are not working.
For examlple I've a cOSdMenu derived class and want to add an entry (simplified):
class cItems : public cOsdMenu { private: int item_type; char *header; char *name; public: cItems::cItems(int Type,const char *Text,const char *Header); virtual ~cItems(); virtual eOSState ProcessKey(eKeys Key); };
class cItemsEntry : public cOsdItem { private: char *entry; public: cItemsEntry(const char *Entry); ~cItemsEntry(); }
cItems::cItems(int Type,const char *Text,const char *Header) :cOsdMenu("") { item_type = Type; header = strdup(Header); name = strdup(Text);
[...]
// Display in columns cItemsEntry *entry = new cItemsEntry("Col1 \t Col2 \t Col3"); Add(entry);
Display(); }
cItemsEntry::cItemsEntry(const char *Entry) { entry = strdup(Entry); SetText(entry,false); }
The entry is displayed as "Col1", so the text behind the first tabular just disappears. Where is the error???
ciao Richard Reuters
Hi,
you have to tell VDR the column length in the constructor, like this:
cMenuEPGSearchExt::cMenuEPGSearchExt() :cOsdMenu("", 2, 20, 11, 6, 5)
Christian
----- Original Message ----- From: "Richard Reuters" Lists@reuters-it.com To: "VDR Mailinglinst" vdr@linuxtv.org Sent: Friday, March 10, 2006 12:00 PM Subject: [vdr] Problems with TABs in OSD
I'm writing a plugin and would like to display some OSD output in columns like many other plugins and vdr itself does. But special characters like '\t' for a tabulator are not working.
For examlple I've a cOSdMenu derived class and want to add an entry (simplified):
class cItems : public cOsdMenu { private: int item_type; char *header; char *name; public: cItems::cItems(int Type,const char *Text,const char *Header); virtual ~cItems(); virtual eOSState ProcessKey(eKeys Key); };
class cItemsEntry : public cOsdItem { private: char *entry; public: cItemsEntry(const char *Entry); ~cItemsEntry(); }
cItems::cItems(int Type,const char *Text,const char *Header) :cOsdMenu("") { item_type = Type; header = strdup(Header); name = strdup(Text);
[...]
// Display in columns cItemsEntry *entry = new cItemsEntry("Col1 \t Col2 \t Col3"); Add(entry);
Display(); }
cItemsEntry::cItemsEntry(const char *Entry) { entry = strdup(Entry); SetText(entry,false); }
The entry is displayed as "Col1", so the text behind the first tabular just disappears. Where is the error???
ciao Richard Reuters
vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Richard Reuters wrote:
I'm writing a plugin and would like to display some OSD output in columns like many other plugins and vdr itself does. But special characters like '\t' for a tabulator are not working.
For examlple I've a cOSdMenu derived class and want to add an entry (simplified):
class cItems : public cOsdMenu { private: int item_type; char *header; char *name; public: cItems::cItems(int Type,const char *Text,const char *Header); virtual ~cItems(); virtual eOSState ProcessKey(eKeys Key); };
class cItemsEntry : public cOsdItem { private: char *entry; public: cItemsEntry(const char *Entry); ~cItemsEntry(); }
cItems::cItems(int Type,const char *Text,const char *Header) :cOsdMenu("")
Here you have to specify TAB-positions for your menu:
cItems::cItems(int Type,const char *Text,const char *Header) :cOsdMenu("", 20, 10)
will give you columns at 0, 20 and 30. Column seperation is done via \t as you already found out.
Good luck Peter
Richard Reuters wrote:
I'm writing a plugin and would like to display some OSD output in columns like many other plugins and vdr itself does. But special characters like '\t' for a tabulator are not working.
You need to specify the tabstop columns. This is done using the protected SetCols() method or the not very obvious cOsdMenu(c0...c4) constructor parameters.
Cheers,
Udo