PlanetSquires Forums

Support Forums => General Board => Topic started by: Petrus Vorster on June 16, 2014, 01:42:18 PM

Title: Just out of curiosity
Post by: Petrus Vorster on June 16, 2014, 01:42:18 PM
I saw a point of sale the other day that uses a large rectangular flat screen embedded in a service counter.
Being into programming one could easily recognize the controls that was used: Textbox, Gridview etc.
But one part of the form had the controls upside down so the customer could view the list of purchases on the same screen the employee was working on whom had his portion of the form facing him.

So how the heck do you make upside down controls and text like that on the same form as all the others facing the right way?
It was definitely a desktop app, but whoever wrote this sure as hell knew his way around a pc and design.

I don't need to do this, but i am curious how they turned all the control upside down.
Title: Re: Just out of curiosity
Post by: Rolf Brandt on June 20, 2014, 06:47:06 AM
Here is a little example how to draw text upside down in a graphic window. It is based on a code example of Borje Haagsten:
http://www.powerbasic.com/support/pbforums/showpost.php?p=431641&postcount=12

However, how to draw controls upside down I have no idea of.

'====================================================================
#COMPILE EXE

'********************************************************************
FUNCTION PBMAIN () AS LONG
'--------------------------------------------------------------------
' Program entrance
'--------------------------------------------------------------------
  LOCAL hDlg, hFont AS DWORD
  '------------------------------------------------------------------
  GRAPHIC WINDOW "Graphic Text Rotation", 0, 0, 640, 480 TO hDlg
  GRAPHIC ATTACH hDlg, 0
  GRAPHIC CLEAR RGB(0, 0, 0), RGB(0,0,0)

  '------------------------------------------------------------------
  ' Print some rotated text, Create a rotated font (FONT NEW), set it
  ' to Graphic control (GRAPHIC SET FONT), print text and delete the
  ' rotated font (FONT END) to avoid memory leaks.
  '------------------------------------------------------------------
  'GRAPHIC BOX (0, 0) - (80, 400),,RGB(0, 0, 64), RGB(0, 64, 128)
  GRAPHIC COLOR %YELLOW, -2

  FONT NEW "Times New Roman", 20, 3, 0, 0, 0 TO hFont
  GRAPHIC SET FONT hFont
  GRAPHIC SET POS (320, 320)
  GRAPHIC COLOR RGB(RND(0,255),0,0)
  GRAPHIC PRINT "This is NORMAL view"
  FONT END hFont

  FONT NEW "Times New Roman", 20, 3, 0, 0, 1800 TO hFont
  GRAPHIC SET FONT hFont
  GRAPHIC SET POS (320, 160)
  GRAPHIC COLOR RGB(0,255,255)
  GRAPHIC PRINT "This is UPSIDEDOWN"
  FONT END hFont

  '------------------------------------------------------------------
  SLEEP 10000
  GRAPHIC WINDOW END

END FUNCTION


Rolf
Title: Re: Just out of curiosity
Post by: Elias Montoya on June 23, 2014, 03:17:41 AM
Several ways to achieve this come to my mind. One can be to intercept the drawing event, capture the Device context handle and capture whats on screen, then reverse it in memory and BitBlt the reversed DC manually. You can even make the reversed control responsive by intercepting and reversing the mouse input the same way.

Another way is to create a virtual mini desktop with reversed properties, but i dont remember how.

A third way is to create custom controls. But it is too ellaborate.
Title: Re: Just out of curiosity
Post by: Elias Montoya on June 23, 2014, 03:20:06 AM
 I believe Windows 7 uses the first method for creating the thumbnails when user hovers mouse on the windows bar.

By the way, several other methods come to my mind when using Windows Vista or newer, but they would not work in earlier OS's.
Title: Re: Just out of curiosity
Post by: Petrus Vorster on June 24, 2014, 03:50:44 PM
 ;D ;D
Cool, it really was an amazing piece of work, suppose some bigshot corporation made it.