View previous topic :: View next topic |
Author |
Message |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8012 Location: Salford, UK
|
Posted: Sat Sep 23, 2023 6:37 am Post subject: |
|
|
Plato will usually find the help for the format codes when you put the text cursor in the code and press F1. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2864 Location: South Pole, Antarctica
|
Posted: Sat Sep 23, 2023 6:56 am Post subject: |
|
|
Paul,
First impressions: SET_CONTROL_VISIBILITY crash the code with "invalid control handle" if you open some window twice (hence change the handle which has to be in global variables to be controlled from everywhere), close the second one and try to use first one again. Such mistakes of clicking twice happen all the time. Since Clearwin now taking the policy like with OpenGL to never crash without user consent, would be great either just ignore wrong handle or ask user to allow crash for debugging purposes
Yes, 16x16 icon is fine
The %ld bitmap needs a bit of a facelift. I remember now trying it long ago but refused to use. Also, can you take my nice red dot above for some controls ? Users for sure will like it. I have them different color and size, but you are free to grab it and edit at your taste. Or i can send them to you.
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8012 Location: Salford, UK
|
Posted: Sat Sep 23, 2023 9:42 am Post subject: |
|
|
Dan
If you post some code illustrating the failure then someone will be able to identify where the error occurs.
Likewise I would be able to see if ClearWin+ could respond in a better way. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2864 Location: South Pole, Antarctica
|
Posted: Sat Sep 23, 2023 12:22 pm Post subject: |
|
|
If we just comment two lines in your example which will simulate the case of creating window which lost the handle due to user manipulations (often by mistake) and then calling set_control_visibility we get the crash. Usually crashing for such small reason the whole GUI is always kind of pity. This is why OpenGL just ignores errors. Your last approach with Clearwin is smarter, though may be more cumbersome for you, developers - to allow user to chose
Code: | winapp
module mm
use clrwin
integer(7) hwnd
integer state
contains
integer function cb()
state = 1 - state
call SET_CONTROL_VISIBILITY@(hwnd, state)
cb = 2
end function
end module mm
program main
use mm
state = 1
!iw = winio@("%ic[icon1]&")
!iw = winio@("%lc&", hwnd)
iw = winio@("%ff%nl%cn&")
iw = winio@("%^bt[Show/Hide]",cb)
end program
resources
1 24 default.manifest
icon1 ICON bull01.ico |
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8012 Location: Salford, UK
|
Posted: Sat Sep 23, 2023 1:09 pm Post subject: |
|
|
I have fixed that particular error report so that you will get a message with the option to continue. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2864 Location: South Pole, Antarctica
|
Posted: Sun Sep 24, 2023 11:14 am Post subject: |
|
|
Thanks, Paul.
Will add for everyone here that of course using bitmap graphics files with %bm instead of icons %ic works same way. This could be more useful because making icons could be cumbersome and they are standard size 16x16 or 32x32 while %bm could be any size.
Also by some reason %ic is not transparent if you use background in the main window.
( see large white space around red dot). I tried with SCION editor from FTN95 compiler directory to make empty space of bullet image transparent but did not succeed with first couple attempts, not really trying hard. So i cut the bullet out of larger image file and used %bm instead of %ic which looks much better. Of course with squared images all will look flawless. Same flawless result can be obtained with editing red dot bitmap, adding pink background there. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8012 Location: Salford, UK
|
Posted: Sat Nov 11, 2023 2:45 pm Post subject: |
|
|
In a future release of ClearWin+, %si will take a tilde accent together with a "show/hide" integer variable as illustrated here...
Code: | module mm
use clrwin
integer k
contains
integer function cb()
k = 1 - k
cb = 1
end function
end module
winapp
program main
use mm
integer iw,winio@
k = 1
iw = winio@("%cn%~si!&", k)
iw = winio@("%ff%nl%cn%10^bb[Show-Hide]", cb)
end program main
resources
1 24 default.manifest
|
|
|
Back to top |
|
|
|