neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
934 stars 189 forks source link

Cursor marker #251

Open Ulli2k opened 5 years ago

Ulli2k commented 5 years ago

I got my u8g2 Display working!

Currently the cursor marks the line by changing the background colour. How can I change it back to have a marker in the front of the line like:

   Op1
> Op2
   OP3

Additionally I do not understand who to configure the following struct. Is there a HowTo?

  const colorDef<uint8_t> colors[] MEMMODE={ //  {{disabled normal,disabled selected},{enabled normal,enabled selected, enabled editing}}
    {{0,0},{0,1,0}},//bgColor
    {{0,0},{1,1,1}},//fgColor
    {{1,1},{1,0,0}},//valColor
    {{1,1},{1,0,0}},//unitColor
    {{0,0},{0,0,1}},//cursorColor
    {{1,1},{1,0,0}},//titleColor
  };
neu-rah commented 5 years ago

Currently the cursor marks the line by changing the background colour. How can I change it back to have a marker in the front of the line like

only by changing the u8g2 driver to print as text style and yet use u8g2 print functions

Additionally I do not understand who to configure the following struct. Is there a HowTo?

They should be on wiki... however comments might be helpful,

bgColor - definition of background colors (see line description bellow)
fgColor - foreground colors
valColor - field value
unitColor - field value unit
cursorColor - cursor
titleColor - menu title

each line contains values in two groups for disabled and enabled items

first group, disabled item colors
{disabled normal,disabled selected}

second group, enabled item colors for use when normal, selected or editing
{enabled normal,enabled selected, enabled editing}

the above table show a mono-chrome color table (colors only 0 or 1) but the color format depends on the device, always on the same order.

note: some combinations might have no expression on some drivers

Ulli2k commented 5 years ago

Ok, therefore the u8g2 driver is only supporting the cursor by changing the backgroundcolor of the row.

I already read the comments. But I do not understand way I can disable the item color with two values. (1,0) (.....) disable in normal mode (....) (0....) disable in normal mode Am I right?

neu-rah commented 5 years ago

no, you do not disable the item color, that color definition is for the menu system to use when drawing disabled item, items are enabled/disabled by the code

p.s.

if it helps there is still a graphic driver that uses a text cursor > (SSD1306ascii), because at the time the driver was written the device was not supporting video inversion.