programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: OFN-DIALOG

From: Rick VanNorman <rvn_at_forth.com>
Date: Mon, 08 Nov 1999 14:42:08 -0800

>From: "Gene LeFave" <gene_at_tekdata.com>
>
>Oops, I was too fast on the trigger, here is my open file dialog:
>
>Gene
>
>256 BUFFER: IRLFILE
>OFN-DIALOG SUBCLASS CHOOSE-FILE-DIALOG
> CREATE IRL-FILES
> ,Z" IRL files (*.IRL)" ,Z" *.IRL"
> 0 ,
>
> : CUSTOM ( --title filter flags)
> Z" Choose IRL file" IRL-FILES
> OFN_HIDEREADONLY
> OFN_LONGNAMES OR
> OFN_FILEMUSTEXIST OR
> OFN_NOCHANGEDIR OR ;
>END-CLASS
>
>: CHOOSE-FILE ( --)
> [OBJECTS
> CHOOSE-FILE-DIALOG MAKES CFD
> OBJECTS]
> CFD CHOOSE IF
> CFD FILENAME ZCOUNT IRLFILE PLACE
> ELSE 0 IRLFILE ! THEN ;

Simple enough. Go to the API and look up the OPENFILENAME data structure
which the dialog is based on and uses. It has a field for the initial directory
named

        zInitialDir \ where to run, NULL is current

CUSTOM is designed to set the other defaults as well as to return the
items it does, so it would become:

        : CUSTOM ( --title filter flags)
           Z" C:\MY\DIRECTORY\WHEREEVER" zInitialDir !
             Z" Choose IRL file" IRL-FILES
             OFN_HIDEREADONLY
             OFN_LONGNAMES OR
             OFN_FILEMUSTEXIST OR
             OFN_NOCHANGEDIR OR ;

How's that?

Rick

.

>From gene_at_tekdata.com Mon Nov 8 17:25:51 1999
To: sftalk_at_forth.com
Message-Id: <m0000612_at_gerd.forthinc.com>
Date: Mon, 8 Nov 1999 17:25:51 -0600
From: "Gene LeFave" <gene_at_tekdata.com>
Subject: Re: [sftalk] OFN-DIALOG

Thanks RICK,

I looked at the file structure, but I missed the zinitialDIR.

Gene

> Date: Mon, 08 Nov 1999 14:42:08 -0800
> From: "Rick VanNorman" <rvn_at_forth.com>
> Subject: Re: OFN-DIALOG
>
> >From: "Gene LeFave" <gene_at_tekdata.com>
> >
> >Oops, I was too fast on the trigger, here is my open file dialog:
> >
> >Gene
> >
> >256 BUFFER: IRLFILE
> >OFN-DIALOG SUBCLASS CHOOSE-FILE-DIALOG
> > CREATE IRL-FILES
> > ,Z" IRL files (*.IRL)" ,Z" *.IRL"
> > 0 ,
> >
> > : CUSTOM ( --title filter flags)
> > Z" Choose IRL file" IRL-FILES
> > OFN_HIDEREADONLY
> > OFN_LONGNAMES OR
> > OFN_FILEMUSTEXIST OR
> > OFN_NOCHANGEDIR OR ;
> >END-CLASS
> >
> >: CHOOSE-FILE ( --)
> > [OBJECTS
> > CHOOSE-FILE-DIALOG MAKES CFD
> > OBJECTS]
> > CFD CHOOSE IF
> > CFD FILENAME ZCOUNT IRLFILE PLACE
> > ELSE 0 IRLFILE ! THEN ;
>
>
> Simple enough. Go to the API and look up the OPENFILENAME data structure
> which the dialog is based on and uses. It has a field for the initial
> directory named
>
> zInitialDir \ where to run, NULL is current
>
> CUSTOM is designed to set the other defaults as well as to return the
> items it does, so it would become:
>
>
> : CUSTOM ( --title filter flags)
> Z" C:\MY\DIRECTORY\WHEREEVER" zInitialDir !
> Z" Choose IRL file" IRL-FILES
> OFN_HIDEREADONLY
> OFN_LONGNAMES OR
> OFN_FILEMUSTEXIST OR
> OFN_NOCHANGEDIR OR ;
>
> How's that?
>
> Rick
>
>
>

.

>From dwanway_at_cpinternet.com Tue Nov 9 19:43:12 1999
To: sftalk_at_forth.com
Message-Id: <m0000613_at_gerd.forthinc.com>
Date: Tue, 9 Nov 1999 19:43:12 -0600
From: "Dorothy Anway" <dwanway_at_cpinternet.com>
Subject: mouse roller and mouse three button

>From Allen Anway, Superior, WI
Reply to Kevin Appert, mouse roller inside or outside application? The
mouse roller is inside the Forth application. If one rolls the roller it is
to be the same as pressing one of the four arrow keys.

Reply to Kevin Appert, program for a three button mouse printing characters.

The original program was written for a two button mouse. One pressed the
buttons in a particular order and could generate 5 or 6 characters as if by
typing them, characters A B C D E being necessary by this means. Fred
Warren wrote a copyrighted Forth program to achieve this. I thought it was
great. My client hated it. He wanted his three button mouse pattern. Here
one didn't worry about the order of button pushing. So I modified Fred
Warren's program to achieve my new goal. Begging Fred's indulgence, I
present my modification.

\ Original copyrighted by Fred Warren
\ Modified by Allen Anway for 3 button mouse
\ 4 2 1 values of mouse keys
\ character produced
\ L <Enter> or ascii 13
\ L M A
\ M B
\ M R C
\ L R D
\ L M R E
\ R <Esc> or ascii 27

1 IMPORT: MessageBeep

: OR! DUP @ ROT OR SWAP ! ;
: /AND! DUP @ ROT -1 XOR AND SWAP ! ;

VARIABLE KeyFlagT
VARIABLE KeyFlagP

: ResetFlags
    0 KeyFlagT ! 0 KeyFlagP ! ;

: SendChar
    DUP HTEXT WM_CHAR ROT 0 SendMessage
    ResetFlags DROP ;

: DOLBUTTONDOWN 4 KeyFlagT OR! 4 KeyFlagP OR! ;
: DOMBUTTONDOWN 2 KeyFlagT OR! 2 KeyFlagP OR! ;
: DORBUTTONDOWN 1 KeyFlagT OR! 1 KeyFlagP OR! ;

: <BUTTONUP> KeyFlagT @ 0=
   IF KeyFlagP @ CASE
     4 OF 13 SendChar ENDOF
     6 OF [CHAR] A SendChar ENDOF
     2 OF [CHAR] B SendChar ENDOF
     3 OF [CHAR] C SendChar ENDOF
     5 OF [CHAR] D SendChar ENDOF
     7 OF [CHAR] E SendChar ENDOF
     1 OF 27 SendChar ENDOF
                              ENDCASE
  THEN ;

: DOLBUTTONUP 4 KeyFlagT /AND! <BUTTONUP> ;
: DOMBUTTONUP 2 KeyFlagT /AND! <BUTTONUP> ;
: DORBUTTONUP 1 KeyFlagT /AND! <BUTTONUP> ;

ALSO CRT
[+SWITCH MESSAGES ( -- res )
   WM_LBUTTONUP RUN: DOLBUTTONUP 0 ;
   WM_LBUTTONDOWN RUN: DOLBUTTONDOWN 0 ;
   WM_MBUTTONUP RUN: DOMBUTTONUP 0 ;
   WM_MBUTTONDOWN RUN: DOMBUTTONDOWN 0 ;
   WM_RBUTTONUP RUN: DORBUTTONUP 0 ;
   WM_RBUTTONDOWN RUN: DORBUTTONDOWN 0 ;
SWITCH]

ONLY FOR ALSO DEFINITIONS \ get rid of CRT

: TEST EKEY DUP . EMIT ;

.
Received on Mon Nov 08 1999 - 14:42:08 PST

This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:07 PST