3

i want to inverse the text in a line and another lines show normally and without inverse in verifone vx520. i use inverse_toggle() function but this function inverse whole of page and not a line. how can i inverse just a line and another lines show as normal?

here is my code:

int display = open(DEV_CONSOLE, 0);
inverse_toggle();
write(display,"first line to inverse\n",22); //i want to inverse just this line
write(display,"second line shown normally\n",27);//i want to show this line normally
Farshid.M
  • 389
  • 2
  • 4
  • 17

1 Answers1

1

I have never played with inverse_toggle or setinverse, but I am noticing that you are not toggling it back off. Try this:

int display = open(DEV_CONSOLE, 0);
inverse_toggle();
write(display,"first line to inverse\n",22);
inverse_toggle(); // new line
write(display,"second line shown normally\n",27);

For more control, use setinverse. Also, check out display_at. I think you'll find it a more user friendly option than write

int display = open(DEV_CONSOLE, 0);
setinverse(1); // explicitly turn inverse on
display_at(1, // x
           1, // y
           "first line to inverse", // no /n needed since we are specifying x and y
           NO_CLEAR); //defined in ACLCONIO.H. Other options are CLR_LINE and CLR_EOL
setinverse(0); // explicitly turn inverse off
display_at(1, 2, display,"second line shown normally", NO_CLEAR);

If that doesn't work, you could always use the font tool to make a new font instead (although that would be more work).

David
  • 4,665
  • 4
  • 34
  • 60
  • when use inverse_toggle() whole of page will be inverse. and for display_at i didn't find any function like that just gotoxy(x,y) and that's don't work correctly and inverse whole of page. – Farshid.M May 30 '15 at 11:39
  • Then you'll probably need to create or find an inverse font. – David May 31 '15 at 02:01
  • I just checked to see if using the `window` command would help, but it doesn't seem to (alas). I think you're going to be stuck with using the font creation tool. The good news is that you can just load in an existing font and then use the "inverse" command. The bad news is that you have to do that for each character--I don't know of a way to "inverse" a whole font all at once. As for "display_at", that's part of the aclconio.h` file. – David Jun 04 '15 at 23:14