Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #6282

Re: Application off the screen

From "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Application off the screen
Date 2013-11-25 16:57 +0100
Organization A noiseless patient Spider
Message-ID <l6vs1n$2gn$1@dont-email.me> (permalink)
References <%7Kku.5$R22.4@fx27.fr7>

Show all headers | View raw


Hi Martin,

below is some code from my applications. It sets also the origin of the 
window and looks for dual monitors. It has worked well for normal monitors.

Arne Ortlinghaus
ACS Data Systems

local cClassName as string
local xW, yH, xVar, yVar as int // probieren, ob es jetzt geht mit Int, weil 
sonst Probleme mit negativen Zahlen  // bei negativen Koordinaten gibt es 
sonst Runtimefehler
local u as usual
local xmax, ymax as int
local xvarmin, yvarmin as int
local nmonitors, nShowState as int
local lOkS, lOkO as logic

VisualThemesExec (#StartScreenWinshellInit, hWnd, self:Handle(4))

snWinshellMinHeight := 580
// auch wenn Themes ausgeschaltet sind, sind die Captions größer
if Isappthemed()
   snWinshellMinHeight := 595
endif

// Fenstergröße und -position aus Registrierung übernehmen
if _oIniFile == null_object
   return nil
endif

nmonitors := GetSystemMetrics(80)
if GetKeyboardkeystates (true, true, nil, false, nil) // shift oder 
Control-Taste gedrückt
   nmonitors := 1
elseif GetSystemMetrics(0x1000) <> 0 .or. GetSystemMetrics(0x2001) > 0
   nmonitors := 1
endif


cClassName := Symbol2String(ClassName(self))
nShowState := _oIniFile:GetInt(cClassName,"Show", 0)


if nmonitors >= 2 // Anzahl Monitore
   NOP() // weitermachen, Programm kann auf zweitem Bildschirm plaziert 
gewesen sein
else
   if nShowState == SHOWZOOMED
      return nil
   endif
endif

xvarmin := 0
yvarmin := 0

xmax := GetSystemMetrics (SM_CXSCREEN)
ymax := GetSystemMetrics (SM_CYSCREEN)

if nmonitors >= 2 // Anzahl Monitore
   xvarmin := GetSystemMetrics(76)
   yvarmin := GetSystemMetrics(77)
   xmax := GetSystemMetrics(78)
   ymax := GetSystemMetrics(79)
endif

//z.B. 4294967288 bei Zoomed (eigentlich negativ, aber es gibt scheinbar 
irgendwo beim speichern überläufe)

u := _oIniFile:GetInt(cClassName,"Width", 0)
if u < 2000000000
   xW := u
else
   xW := GetSystemMetrics (SM_CXSCREEN)
endif

u := _oIniFile:GetInt(cClassName,"Height", 0)
if u < 2000000000
   yH := u
else
   yH := GetSystemMetrics (SM_CYSCREEN)
endif

u := _oIniFile:GetInt(cClassName,"XPos", 0)
if u < 2000000000
   xVar := u
else
   xVar := 0
endif
u := _oIniFile:GetInt(cClassName,"YPos", 0)
if u < 2000000000
   yVar := u
else
   yVar := 0
endif
lOkS := true
lOkO := true


if nmonitors >= 2 // Anzahl Monitore
   if nShowState == SHOWZOOMED
      xW := GetSystemMetrics (SM_CXSCREEN)
      yH := GetSystemMetrics (SM_CYSCREEN)
   endif
endif

if !(nShowState == SHOWZOOMED)
   if lOkS
      if xW <= 0
         lOkS := false
      endif
   endif
   if lOkS
      if yH <= 0
         lOkS := false
      endif
   endif
   if lOkS
      if yH <= snWinshellMinHeight
         lOkS := false
      endif
   endif
   if lOkS
      if xW > xmax
         lOkS := false
      endif
   endif
   if lOkS
      if yH > ymax
         lOkS := false
      endif
   endif
endif

// Prüfungen x, y origin
if lOkS .and. lOkO
   if xVar < 0
      lOkO := false
   endif
endif
if lOkS .and. lOkO
   if xVar + xW > xmax
      lOkO := false
   endif
endif

if lOkS .and. lOkO
   if yVar < 0
      lOkO := false
   endif
endif
if lOkS .and. lOkO
   if yVar + yH > ymax
      lOkO := false
   endif
endif


if lOkS
   if !lOkO
      lOkO := true
      xVar := (xmax-xW)/2
      yVar := (ymax-yH)/2
      if yVar < 40 // eher nach oben verschieben wegen Taskbar
         yVar := (ymax-yH)
      endif
   endif
else
   lOkO := false
endif
//    .and. xVar<= xmax-self:size:Width ;
//  .and. yVar > 0 .and. yVar <= ymax-self:size:Height)
if !(nShowState == SHOWZOOMED)
   if lOkS
      self:size := Dimension{xW, yH}
   endif
endif
if lOkO
 self:origin := Point{xVar,yVar}
endif






"Martin" <spam@spam.spam> schrieb im Newsbeitrag 
news:%7Kku.5$R22.4@fx27.fr7...
> Hello
>
> I have written an application to fit the screen of a computer.
>
> Screen is the size here
>
> Main:Size := Dimension{800,600}
> Main:Show(SHOWNORMAL)
>
> Yet most of the program is off the screen and it is near impossible to 
> pull it back. (touch screen)
>
> Any ideas please? 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Application off the screen Martin <spam@spam.spam> - 2013-11-25 15:36 +0000
  Re: Application off the screen "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2013-11-25 16:57 +0100
    Re: Application off the screen Martin <spam@spam.spam> - 2013-11-27 11:44 +0000
  Re: Application off the screen rap66@abv.bg - 2013-11-25 08:22 -0800

csiph-web