|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Fri Mar 16, 2012 3:33 pm Post subject: Cursor Variation |
|
|
I have created a Clearwin application with several buttons etc. At the right side I have a %gr graphics region. Zooming with the mouse wheel and panning with left mouse button down are working fine. Now I like to have another cursor when the left mouse button is hold down. All my readings and trials did not provide any result: the cross-hair in the graphics region did not change.
Here my code:
Code: | MA = WINIO@ ('%pv&')
MA = WINIO@ ('%`3dc&', CURSOR_ARROW, CURSOR_CROSS, CURSOR_SIZE, iCursorSelect)
MA = WINIO@ ('%`^gr[user_resize,full_mouse_input]&', iCurrDrawSizeX, iCurrDrawSizeY, GR_HANDLE, DrawOnScreen)
MA = WINIO@ ('%mg&', Z'020A', MouseWheel)
MA = WINIO@ ('%ww%es') |
As reaction on mouse actions I change “iCursorSelect” value.
What's wrong?
Thank you in advance
Erwin |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sat Mar 17, 2012 11:01 am Post subject: |
|
|
Erwin,
Is the answer to use %cu ? (Documentation isn't very clear on the differences between a %gr region and elsewhere in a Window).
Eddie
[There are lots more cursors available than stated in the documentation!] |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Sat Mar 17, 2012 11:29 am Post subject: |
|
|
%cu would give you a fixed cursor for the control.
In theory you could use %2dc which provides for two cursors and an integer variable to select either cursor under program control. |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Sat Mar 17, 2012 11:50 am Post subject: |
|
|
Only a few comments, hope they could help:
(1) I think you have a resource script, say erwin_res.rc, with cursors like
Code: | hand CURSOR c:\...\cursors\hand.cur
kreuz CURSOR c:\...\cursors\kreuz.cur |
(2) You have a link to this file just at the start of your (main) programme like
(3) When starting your graphics region, use something like
Code: | j = winio@('%2cu[kreuz][hand]%`^gr[user_surface,'
* //'full_mouse_input,rgb_colours]&',ICURSOR,stg_x,stg_y,ptr,1L,
* DISPLAY) |
Now you can change the value of ICURSOR between 1 and 2, meaning the cursor changes
(4) As Eddie mentioned, see c:\windows\cursors for a lot of standard cursors.
Regards - Wilfried |
|
Back to top |
|
|
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Sat Mar 17, 2012 2:35 pm Post subject: |
|
|
With the cursors from *.cur-files it works fine, with the under %cu listed cursors it does not. !?
Thanks Eddie, Paul and Wilfried.
Regards, Erwin |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sat Mar 17, 2012 4:02 pm Post subject: |
|
|
For once I don't think Paul is right (saying that %cu gives a fixed cursor) - well, at least not according to the documentation. I think %cu has to be %`cu to use the cursors with constants as given in windows.ins, which is why it works as %cu with cursors defined in a RESOURCES section or .RC script - and does not work (as Erwin says) with those constants.
(See %cu in format code reference)
As well as the cursors in \windows\cursors\ it is worth just trying different constants to the ones defined in windows.ins. You can also define your own.
Regards
Eddie |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Wed Jun 13, 2012 9:50 pm Post subject: |
|
|
Here is a brief example code using an animated cursor "SmoothWorking.ani" and a static cursor "SmoothHand.cur" (obtained from the web).
Code: | winapp
program test
include <windows.ins>
integer, external :: iGr
ia=winio@('%ca[test cursor]&')
ia=winio@('%ww&')
ia=winio@('%cu[INDEX]&')
ia=winio@('%pv&')
ia=winio@('%`^gr[white,rgb_colours,user_resize]&',
& 400, 400, iHDC, iGr)
ia=winio@('%ff%2nl%cu[{SmoothWorking.ani}]%6bt[OK]')
END
INTEGER FUNCTION iGr()
iGr = 1
END
RESOURCES
INDEX CURSOR "SmoothHand.cur"
1 24 default.manifest |
If I try to put "SmoothWorking.ani" into the resources section (or in a separate .rc file) it will not compile. Needing to load it from a file makes the program vulnerable to not finding it. If it is not found, then rather than carrying on with the default cursor, FTN95 terminates the program with an error message.
Might it be possible to include support for animated cursors in SRC (as they are clearly supported by direct reading from a file)? As a suggestion for the longer-term, would it be possible to have a routine that trapped such things as unfindable external resources - I was thinking along the lines of:
Code: | IF_EXTERNAL_RESOURCE _IS_NOT FOUND_THEN_USE_DEFAULT@ ('CURSOR') |
... and any other loadable resource for that matter.
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Jun 14, 2012 11:23 am Post subject: |
|
|
If you are reading from a file then fexists@ can be used in your program to check that the file can be found, thus avoiding the fatal error report. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Jun 14, 2012 11:41 am Post subject: |
|
|
Hmmm... I hadn't thought of that. Great suggestion. I think I'm going to explore {} options in a bit more detail now.
The suggested routine name was 'tongue-in-cheek', largely as a result of Dan asking for longer Clearwin codes in another thread ....
Eddie |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2816 Location: South Pole, Antarctica
|
Posted: Sat Jun 16, 2012 11:28 pm Post subject: |
|
|
HI Ed,
WH
SO
FU?
IT
WA
GR
ID
SI
SL
BR!
DO
YU
WA
PR
LO
LI
TH? |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sun Jun 17, 2012 6:48 pm Post subject: |
|
|
Good try Dan, but these are nowhere near as memorable as the Clearwin format codes, and there isn't a code book (even if the one for Clearwin format codes is wrapped up in FTN95.CHM!).
Eddie |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2816 Location: South Pole, Antarctica
|
Posted: Sun Jun 17, 2012 11:56 pm Post subject: |
|
|
You clearwinry have a very good memory. But just wait for the Clearwin version for other compilers. With 1000 times more users and increased demand for new features the amount of codes will increase like a snow ball and look like this
1995
%rf %wf %ff %nl %ww
2012 Help for letter A :
%ac %ap %aw %bc ...
2017 all 26x26 possibilities of English alphabet are exhausted and here is Help for just letter A :
%aa %ab %ac %ad %ae %af %ag %ah %ai %aj %ak %al %am %an %ao %ap %aq %ar %as %at %au %av %aw %ax %ay %az %ba %bb %bc %bd ...
2018 Russian letters б г д ё ф ж з и л п ш щ ю я ъ ь added. Help file just for letter A will look like that
%аб %аг %ад %аё %аф %аж %аз %аи %ал %ап %аш %ащ $аю %ая %аъ %аь %aa %ab %ac %ad %ae %af %ag %ah %ai %aj %ak %al %am %an %ao %ap %aq %ar %as %at %au %av %aw %ax %ay %az %ba ...
2019 German letters ä ö ü ß added. The help for letter A is:
%ää %äb %äc %äd %äe %äf %äg %äh %äi %äj %äk %äl %äm %än %äo %äp %äq %är %äs %ät %äu %äv %äv %äx %äy %äz %аб %аг %ад %аё %аф %аж %аз %аи %ал %ап %аш %ащ $аю %ая %аъ %аь %aa %ab %ac %ad %ae %af %ag %ah %ai %aj %ak %al %am %an %ao %ap %aq %ar %as %at %au %av %aw %ax %ay %az %ba ...
2020 Greek letters α, β, γ, δ, ε, ζ, η, θ, ι, κ, λ, μ, ν, ξ, ο, π, ρ, σ (ς), τ, υ, φ, χ, ψ, ω. added
%αa %αb %αc%αd %αe %αf %αg %αh %αi %αj %αk %αl %αm %αn %αo %αp %αq %αr %αs %αt %αu %αv %αw %αx %αy %αz %ää %äb %äc %äd %äe %äf %äg %äh %äi %äj %äk %äl %äm %än %äo %äp %äq %är %äs %ät %äu %äv %äv %äx %äy %äz %аб %аг %ад %аё %аф %аж %аз %аи %ал %ап %аш %ащ $аю %ая %аъ %аь %aa %ab %ac %ad %ae %af %ag %ah %ai %aj %ak %al %am %an %ao %ap %aq %ar %as %at %au %av %aw %ax %ay %az %ba ...
2021 Numbers added
%a1 %a2 %a3 %a4 %a5 %a6 %a7 %a8 %a9 %αa %αb %αc%αd %αe %αf %αg %αh %αi %αj %αk %αl %αm %αn %αo %αp %αq %αr %αs %αt %αu %αv %αw %αx %αy %αz %ää %äb %äc %äd %äe %äf %äg %äh %äi %äj %äk %äl %äm %än %äo %äp %äq %är %äs %ät %äu %äv %äv %äx %äy %äz %аб %аг %ад %аё %аф %аж %аз %аи %ал %ап %аш %ащ $аю %ая %аъ %аь %aa %ab %ac %ad %ae %af %ag %ah %ai %aj %ak %al %am %an %ao %ap %aq %ar %as %at %au %av %aw %ax %ay %az %b1 ...
2022 Chinese alphabet added. Help for letter A
%诶1 %诶2 %诶3 %诶4 %诶5 %诶6 %诶7 %诶8 %诶9 %诶α %诶β %诶γ %诶δ ... %维维 %比比 %吾艾 %贼德 %艾娜 %克斯 %斯斯 ... %a1 %a2 %a3 %a4 %a5 %a6 %a7 %a8 %a9 %αa %αb %αc%αd %αe %αf %αg %αh %αi %αj %αk %αl %αm %αn %αo %αp %αq %αr %αs %αt %αu %αv
What code is for cursor shape here? %k % v % % |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Tue Jun 19, 2012 11:43 pm Post subject: |
|
|
You have me there Dan. It occurs to me that the whole of Clearwin could equally well have been done with subroutine/function calls one for each format code. The design of the system probably relates back to the computers, software and programming styles available in the early to mid 1990s, and thus contains a great deal of software archaeology.
E |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Jun 20, 2012 7:19 am Post subject: |
|
|
A good way to work is to use the Plato clip library which has a selection of ClearWin+ clips. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2816 Location: South Pole, Antarctica
|
Posted: Thu Jun 21, 2012 6:59 pm Post subject: |
|
|
Paul, clip library is cool, but wouldn't it be feasible to consider making quasi- "operator overloading" of Clearwin codes? Say, if users do not like some codes which look confusing, then they could write special file with user-specific new aliases of Clearwin codes (not substitutions, so that both new and old CWP codes could be understandable to the translator)
Code: |
%cl ==> %Palette
%fl ==> %FPlimits
%eq ==> %Equation
%fs ==> %GetFolderToSave
%co ==> %ModifyRead
%rd ==> %readInt
%rs ==> %ReadChar
|
It's all about little bit more freedom and enjoyment.
Also, on one more side note (sorry to OP, we probably should move these discussions to other thread), when you open clip library, Plato is opening additional "merged" window where you can change its size by the mouse. Unless i missed something and it is already there THAT feature to open merged windows at the left, right, bottom is what i miss most in Clearwin+. Any plans to add it?
Last edited by DanRRight on Fri Jun 22, 2012 9:01 am; edited 1 time in total |
|
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
|