|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
DanRRight
Joined: 10 Mar 2008 Posts: 2892 Location: South Pole, Antarctica
|
Posted: Tue May 18, 2021 7:56 pm Post subject: |
|
|
Looks cool!
Please run this code below as an example
Code: | winapp
program main
real*8 A
common /aaaa/A
integer, external :: Run
a=0.1
i=winio@('%co[warn_on_update]%~fl%rf%`fl&', 0d0,1d0, A)
i=winio@('%ff%^bt[Change A]%es', Run)
end
integer function Run()
include <windows.ins>
real*8 A
common /aaaa/A
A = A + 1
IF(A.GT.2) a=0.1
call window_update@(A)
Run = 2
end function |
Is there similar option when the variable is not corrected and plotted as is?
For example this code always shows variable not larger than 1 while in not corrected case the variable shown has to be 1.1
Or with current case at least let it be corrected but shown it has to be 1.1. The behavior of control has to mimic 1:1 the human manual action otherwise it will be confusing ! When human types 1.1 the warning pops up, human sees 1.1 in red but the code still sees 1. Same i think has to be with artificial intelligence inside the computer code, isn't it ? Why it should be different?
Otherwise if programmatically after clicking we see warning, the number displayed is 1.0, instead of 1.1 it becomes not clear why the warning appeared if all looks OK - the limits are not violated ! |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8083 Location: Salford, UK
|
Posted: Wed May 19, 2021 8:43 am Post subject: |
|
|
Dan
We may have gone full circle. Your latest request could be what you get when calling control_update@ without the new %co options.
Anyway I have now added one more option %co[stet_on_update] that has the desired effect. It keeps everything in one place and makes control_update@ redundant.
The new option will be included in the next release of the DLLs. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2892 Location: South Pole, Antarctica
|
Posted: Wed May 19, 2021 9:37 pm Post subject: |
|
|
Paul,
Everything in one place is good solution. Eager to see what you have got.
When to use window_update@ and when control_update@ ?
Is among these options also not modifying variable (WYSIWYG) option ?
Last edited by DanRRight on Thu May 20, 2021 3:50 am; edited 2 times in total |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1241 Location: Morrison, CO, USA
|
Posted: Thu May 20, 2021 12:57 am Post subject: |
|
|
I, too, am curious about control_update@(). |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8083 Location: Salford, UK
|
Posted: Thu May 20, 2021 6:55 am Post subject: |
|
|
See item 456 in cwplus.enh and http://forums.silverfrost.com/viewtopic.php?t=4217&start=15 post dated November 21 2020.
You can probably use it with the new %co options but it would be better use the latest addition and wait for the next release of the DLLs. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1241 Location: Morrison, CO, USA
|
Posted: Thu May 20, 2021 1:44 pm Post subject: |
|
|
Thanks for the references, Paul. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2892 Location: South Pole, Antarctica
|
Posted: Sat May 29, 2021 4:51 pm Post subject: |
|
|
Look how great it notifies. Try not to notice among 1000 pieces of jumping information! I wasted so much of my own time and supercomputer time by not noticing some small parameters which were wrong. This was not 3 seconds but weeks and months. Thanks Paul for stet_on_update option ( i = winio('%co[stet_on_update]%~fl%8rf%`fl%`co&', overfill ). Before this would be shown as just the number 1 in black like all others and you would not notice it
|
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2892 Location: South Pole, Antarctica
|
Posted: Fri Jan 21, 2022 11:43 am Post subject: |
|
|
Paul,
Suggestion for possibly small correction.
I like this stet_on_update very much. It saved me days, i do not do costly mistakes anymore when not notice some parameter is out of range
The only i suggest is to return to your first version of such bullets with smaller size of warnings signs like i photoshopped below. The one out of 4 plotted below near 1.052 looks aesthetically the best. Current ones are largest here, they often mess with the neighbor controls.
|
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2892 Location: South Pole, Antarctica
|
Posted: Fri Jan 21, 2022 3:49 pm Post subject: |
|
|
UPDATE: Even worse situation is with current large warning bullets is when the variable returns to allowed range. In this case only part of red cross disappears while approximately 1/3 of the tip of it remains orphaned because it belongs to the line before the current one |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8083 Location: Salford, UK
|
Posted: Sat Jan 22, 2022 10:34 am Post subject: |
|
|
It should no be possible for 32x32 bit icons to appear in this context but I have removed them from the resource data so this ought to prevent it from happening in the future. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2892 Location: South Pole, Antarctica
|
Posted: Sat Jan 22, 2022 2:41 pm Post subject: |
|
|
Thanks
One more small defect:
Code: | ...%`bg[white]%rd... |
seems is not working, it keeps the same gray background gray. Changing it, say, to %`bg[red] works fine, as well as
Code: | ...%bg%rd...@rgb@(255,255,255) ) |
also works fine but is a bit less convenient |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8083 Location: Salford, UK
|
Posted: Sun Jan 23, 2022 9:36 am Post subject: |
|
|
Dan
Can you post a small sample program. It seems to work for me.
Code: | winapp
program main
integer n,iw,winio@
n = 12
iw = winio@("%bg[BTNFACE]&")
iw = winio@("%`bg[white]%rd", n)
end program main |
|
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2892 Location: South Pole, Antarctica
|
Posted: Sun Jan 23, 2022 11:15 am Post subject: |
|
|
Welcome to my traditional weekend's devilry . The problem is again in the Property sheet. I am surprised people are not using it - this is one of the greatest thing in the Clearwin Windows GUI, it makes your programs not just modern but immensely more USABLE
Here is the demo, click on top Sheet1. First "Variab i" is of default color - gray, second one Variab ii supposed to be white but it does not work and stays gray, third one Variab iii i made same way as white but set it yellow instead of white and it works. Below are some examples of my property sheets
Code: | module aps_top
implicit none
integer ::ptr
contains
integer function cbupdate()
use mswin
call see_propertysheet_page@(ptr)
cbupdate=2
end function cbupdate
end aps_top
! *******************************************
! * Changes the bottom property sheet *
! *******************************************
module aps_bottom
use mswin
implicit none
integer :: xptr
contains
integer function xcbupdate()
implicit none
call see_propertysheet_page@(xptr)
xcbupdate=2
end function xcbupdate
end aps_bottom
winapp
program propsht
use mswin
use aps_top
use aps_bottom
integer :: i
integer :: ps1,ps2,ps3
integer :: xps1,xps2,xps3
ps1=1;ps2=2;ps3=2;xps1=1;xps2=2;xps3=3
ptr=2;xptr=3
!****************************************************************************
!* Changes the top property sheet *
!****************************************************************************
i=winio@('%ca[ Sheet 1]&')
ii=12345; iii=123456; iiii=1234567
i=winio@('Variab i %ta%rd%ff&', ii )
i=winio@('Variab ii %ta%`bg[white]%rd%ff&', iii )
i=winio@('Variab iii %ta%`bg[yellow]%rd%ff&', iiii )
i=winio@('Sheet one %bt[hellow aaa world]%sh',ps1)
i=winio@('%ca[ Sheet 2]&')
i=winio@('Sheet two %bt[hellow xxx world]%sh',ps2)
i=winio@('%ca[ Sheet 3]&')
i=winio@('Sheet three %bt[hellow zzz world]%sh',ps3)
i=winio@('%ca[ Sheet 1]&')
i=winio@('Sheet one %bt[hellow aaa world]%sh',xps1)
i=winio@('%ca[ Sheet 2]&')
i=winio@('Sheet two %bt[hellow xxx world]%sh',xps2)
i=winio@('%ca[ Sheet 3]&')
i=winio@('Sheet three %bt[hellow zzz world]%sh',xps3)
i=winio@('%ca[Grave PS Example]&')
i=winio@('%bg[btnface]&')
i=winio@('%sy[thin_border]&')
i=winio@('%ob[raised]&')
i=winio@('This is property sheet 1%ff%nl&')
i=winio@('%`3ps&',ps1,ps2,ps3,ptr)
i=winio@('%ff%nlView Sheet Number:-&')
i=winio@('%`bg[window]%il%dd%3^rd&',1,3,1,ptr,cbupdate)
i=winio@('%cb&')
i=winio@('%ff%nl%ob[raised]&')
i=winio@('This is property sheet 2%ff%nl&')
i=winio@('%`3ps&',xps1,xps2,xps3,xptr)
i=winio@('%ff%nlView Sheet Number:-&')
i=winio@('%`bg[window]%il%dd%3^rd&',1,3,1,xptr,xcbupdate)
i=winio@('%cb%ff&')
i=winio@('%cn%bt[OK] %bt[Cancel]')
end program propsht |
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8083 Location: Salford, UK
|
Posted: Mon Jan 24, 2022 10:26 am Post subject: |
|
|
The fault is in the sample Fortran program and the ordering of the formats codes.
Each sequence containing a %sh must terminate with a corresponding format string that does not end with an ampersand. This creates a sub window or "sheet".
To make it easier to read, start each sequence with %sh, then %ca, then the codes for the content, ending with a string without the ampersand at the end.
Here is a reduced sample that illustrates the point.
Code: | module aps_top
implicit none
integer ::ptr
contains
integer function cbupdate()
use clrwin
call see_propertysheet_page@(ptr)
cbupdate=2
end function cbupdate
end aps_top
winapp
program propsht
use aps_top
integer :: i,iii,iiii,ps1,ps2
iii=123456; iiii=1234567
i=winio@('%sh&',ps1)
i=winio@('%ca[ Sheet 1]&')
i=winio@('This is property sheet 1%2nl&')
i=winio@('Variab ii %ta%`bg[white]%rd%ff&', iii)
i=winio@('Variab iii %ta%`bg[yellow]%rd%ff', iiii)
i=winio@('%sh&',ps2)
i=winio@('%ca[ Sheet 2]&')
i=winio@('Sheet two %bt[Hello World]')
i=winio@('%`2ps&',ps1,ps2,ptr)
i=winio@('%ff%nlView Sheet Number:-&')
i=winio@('%`bg[window]%il%dd%3^rd',1,2,1,ptr,cbupdate)
end program propsht |
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2396 Location: Yateley, Hants, UK
|
Posted: Mon Jan 24, 2022 10:19 pm Post subject: |
|
|
Dan,
Or 3 lines of code if you use a DO loop, and keep the variables in an array.
As in:
Code: | DO 100, I=1,100
IW = WINIO@('%nl%rf etc &', VALUE(I) )
100 CONTINUE |
Eddie |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|