Silverfrost Forums

Welcome to our forums

Cursor Variation

16 Mar 2012 2:33 #9831

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:

    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

17 Mar 2012 10:01 #9835

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!]

17 Mar 2012 10:29 #9836

%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.

17 Mar 2012 10:50 #9837

Only a few comments, hope they could help:

(1) I think you have a resource script, say erwin_res.rc, with cursors like

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

WINAPP 'erwin_res'

(3) When starting your graphics region, use something like

      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

17 Mar 2012 1:35 #9838

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

17 Mar 2012 3:02 #9840

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

13 Jun 2012 8:50 #10336

Here is a brief example code using an animated cursor 'SmoothWorking.ani' and a static cursor 'SmoothHand.cur' (obtained from the web).

      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:

IF_EXTERNAL_RESOURCE _IS_NOT FOUND_THEN_USE_DEFAULT@ ('CURSOR')

... and any other loadable resource for that matter.

Eddie

14 Jun 2012 10:23 #10345

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.

14 Jun 2012 10:41 #10348

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

16 Jun 2012 10:28 #10356

HI Ed, WH SO FU?
IT WA GR ID SI SL BR! DO YU WA PR LO LI TH?

17 Jun 2012 5:48 #10360

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

17 Jun 2012 10:56 #10364

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 % %

19 Jun 2012 10:43 #10373

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

20 Jun 2012 6:19 #10374

A good way to work is to use the Plato clip library which has a selection of ClearWin+ clips.

21 Jun 2012 5:59 (Edited: 22 Jun 2012 8:01) #10381

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)

%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?

22 Jun 2012 5:55 #10386

Docking dialogs are part of the Microsoft Foundation Classes and these are not easily accessible from ClearWin+. Naturally you can already create independent windows but I suspect you mean something more than this.

22 Jun 2012 8:12 #10389

I mean actually very simple thing. You guys wrote this Plato GUI - what i want is exactly the same design implemented with CWP of 2-4 connected windows from each side sharing the same desktop space. I.e. the same functionality as when you open the Clip Library -- and additional narrow window at the right appears, or you open Projects and window at the left appears showing you folders etc. It's like some kind of complex %ob/%cb windows structure but with mouse re-sizable borders

22 Jun 2012 7:12 #10398

OK sounds like you want docking dialogs. The best I can do is to put this in the wish list for now. In any case it would mean my finding a way to access the MFC if this is allowed. To do it from scratch would be a major task.

24 Jun 2012 11:19 #10416

Sounds good!

Please login to reply.