Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #6281 > unrolled thread
| Started by | Martin <spam@spam.spam> |
|---|---|
| First post | 2013-11-25 15:36 +0000 |
| Last post | 2013-11-25 08:22 -0800 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
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
| From | Martin <spam@spam.spam> |
|---|---|
| Date | 2013-11-25 15:36 +0000 |
| Subject | Application off the screen |
| Message-ID | <%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?
[toc] | [next] | [standalone]
| From | "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> |
|---|---|
| Date | 2013-11-25 16:57 +0100 |
| Message-ID | <l6vs1n$2gn$1@dont-email.me> |
| In reply to | #6281 |
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?
[toc] | [prev] | [next] | [standalone]
| From | Martin <spam@spam.spam> |
|---|---|
| Date | 2013-11-27 11:44 +0000 |
| Message-ID | <ZVklu.36$4M4.10@fx12.fr7> |
| In reply to | #6282 |
Thanks both will look through later
On 25/11/2013 15:57, Arne Ortlinghaus wrote:
> 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?
>
[toc] | [prev] | [next] | [standalone]
| From | rap66@abv.bg |
|---|---|
| Date | 2013-11-25 08:22 -0800 |
| Message-ID | <60f28b11-9684-4ca1-ad11-f4118b06a14e@googlegroups.com> |
| In reply to | #6281 |
FUNCTION DesctopDimension()
LOCAL oDim AS Dimension
LOCAL xFullScreen, yFullScreen AS USUAL
//LOCAL pRect IS _WinRect
yFullScreen := GetSystemMetrics( SM_CYFULLSCREEN ) + GetSystemMetrics( SM_CYCAPTION )
xFullScreen := GetSystemMetrics( SM_CXFULLSCREEN )
// SystemParametersInfo( SPI_GETWORKAREA, 0, @pRect, 0 )
// yFullScreen := pRect.bottom
// xFullScreen := pRect.right
oDim := Dimension{ xFullScreen, yFullScreen }
RETURN oDim
METHOD CompareMaxDimension() CLASS Window
LOCAL rect IS _WinRect
LOCAL oDim AS Dimension
LOCAL oPoint AS Point
LOCAL XMaxTrack, YMaxTrack AS USUAL
LOCAL XMinTrack, YMinTrack AS USUAL
LOCAL xFullScreen, yFullScreen AS USUAL
LOCAL yCaption AS USUAL
LOCAL lUpdate AS LOGIC
GetWindowRect( SELF:Handle(), @rect)
yCaption := GetSystemMetrics( SM_CYCAPTION )
// Ìèíèìàëíè/Ìàêñèìàëíè ðàçìåðè
XMaxTrack := GetSystemMetrics( SM_CXMAXTRACK )
YMaxTrack := GetSystemMetrics( SM_CYMAXTRACK )
XMinTrack := GetSystemMetrics( SM_CXMINTRACK )
YMinTrack := GetSystemMetrics( SM_CYMINTRACK )
oDim := Dimension{ SELF:Size:Width, SELF:Size:Height }
oDim:Height := Max( oDim:Height, YMinTrack )
oDim:Height := Min( oDim:Height, YMaxTrack - yCaption )
oDim:Width := Max( oDim:Width, xMinTrack )
oDim:Width := Min( oDim:Width, xMaxTrack )
lUpdate := ( oDim:Height <> SELF:Size:Height ) .or. ( oDim:Width <> SELF:Size:Width )
IF lUpdate
SELF:Size := oDim
ENDIF
// Èçëèçà èçâúí ðàçìåðèòå íà åêðàíà
yFullScreen := GetSystemMetrics( SM_CYFULLSCREEN )
xFullScreen := GetSystemMetrics( SM_CXFULLSCREEN )
oPoint := SELF:Origin
IF ( rect.top < 0 )
oPoint:y += Abs( rect.top )
ENDIF
IF ( rect.left < 0 )
opoint:X += Abs( rect.left )
ENDIF
lUpdate := ( oPoint:Y <> SELF:Origin:Y ) .or. ( oPoint:X <> SELF:Origin:X )
IF lUpdate
SELF:Origin := oPoint
oPoint := SELF:Origin
ENDIF
IF rect.bottom > ( yFullScreen + yCaption )
oPoint:y -= rect.bottom - ( yFullScreen + yCaption )
ENDIF
IF rect.right > ( xFullScreen )
oPoint:x -= rect.right - xFullScreen
ENDIF
lUpdate := ( oPoint:Y <> SELF:Origin:Y ) .or. ( oPoint:X <> SELF:Origin:X )
IF lUpdate
SELF:Origin := oPoint
ENDIF
RETURN NIL
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web