From: Steve Graham
Subject: Windows Question
Date: 
Message-ID: <3F46C189.8090407@comcast.net>
I have a Windows project in which I need to:
1) Draw a grid on the screen;
2) Completely blacken out some of the square;
3) In some of the non-blackened out squares put a small number in the 
top left or right corner; and
4) In some of the non-blackened out squares put a letter which occupies 
most of the space.

I have not done any real Windows programming, so this is maybe quite 
easily done.  I'm wondering if this is doable in any commercial or 
non-commercial version of Lisp.

TIA, Steve Graham

From: Kenny Tilton
Subject: Re: Windows Question
Date: 
Message-ID: <3F46D306.8060803@nyc.rr.com>
Steve Graham wrote:
> I have a Windows project in which I need to:
> 1) Draw a grid on the screen;
> 2) Completely blacken out some of the square;
> 3) In some of the non-blackened out squares put a small number in the 
> top left or right corner; and
> 4) In some of the non-blackened out squares put a letter which occupies 
> most of the space.
> 
> I have not done any real Windows programming, so this is maybe quite 
> easily done.  I'm wondering if this is doable in any commercial or 
> non-commercial version of Lisp.

Sure, but you'll be drawing the boxes and placing the characters and the 
letter numbers yourself, by thinking out the coordinates. Easy stuff 
once you think about it. The only tricky part is the win32 GDI graphics 
library you have to go thru. ACL and LW are pricey, but offer Lisp 
wrappers for the win32 GDI (I mean, a framework which closely parallels 
but hides the GDI). ACL and CormanCL (less pricey) also provide true 
wrappers for GDI calls. ie, the calls are the same as the GDI calls, thx 
to FFI bindings to the actual GDI functions.

But you still have to think about font size info and the GDI coordinate 
system, but there is glue also to the font info, and the coordinate 
system is manageable.

Now check out:

    http://www.tilton-technology.com/Acrostic.html

...and try not to drool on your keyboard. :) That is an ACL project 
which uses my Cells software. It might port to Corman with a lot of cursing.



-- 

  kenny tilton
  clinisys, inc
  http://www.tilton-technology.com/
  ---------------------------------------------------------------
"Career highlights? I had two. I got an intentional walk from
Sandy Koufax and I got out of a rundown against the Mets."
                                                  -- Bob Uecker
From: Steve Graham
Subject: Re: Windows Question
Date: 
Message-ID: <3F46E277.4020807@comcast.net>
Obviously there is more to doing this than just adding the lines, 
characters and numbers.  Is there a recommended text, particularly for 
Lisp, for coming up to speed on win32 GDI?

Thanks again, Steve Graham

===

Kenny Tilton wrote:

>
>
> Steve Graham wrote:
>
>> I have a Windows project in which I need to:
>> 1) Draw a grid on the screen;
>> 2) Completely blacken out some of the square;
>> 3) In some of the non-blackened out squares put a small number in the 
>> top left or right corner; and
>> 4) In some of the non-blackened out squares put a letter which 
>> occupies most of the space.
>>
>> I have not done any real Windows programming, so this is maybe quite 
>> easily done.  I'm wondering if this is doable in any commercial or 
>> non-commercial version of Lisp.
>
>
> Sure, but you'll be drawing the boxes and placing the characters and 
> the letter numbers yourself, by thinking out the coordinates. Easy 
> stuff once you think about it. The only tricky part is the win32 GDI 
> graphics library you have to go thru. ACL and LW are pricey, but offer 
> Lisp wrappers for the win32 GDI (I mean, a framework which closely 
> parallels but hides the GDI). ACL and CormanCL (less pricey) also 
> provide true wrappers for GDI calls. ie, the calls are the same as the 
> GDI calls, thx to FFI bindings to the actual GDI functions.
>
> But you still have to think about font size info and the GDI 
> coordinate system, but there is glue also to the font info, and the 
> coordinate system is manageable.
>
> Now check out:
>
>    http://www.tilton-technology.com/Acrostic.html
>
> ...and try not to drool on your keyboard. :) That is an ACL project 
> which uses my Cells software. It might port to Corman with a lot of 
> cursing.
>
>
>
From: Edi Weitz
Subject: Re: Windows Question
Date: 
Message-ID: <87oeygbx5x.fsf@bird.agharta.de>
On Sat, 23 Aug 2003 03:41:09 GMT, Steve Graham <·········@comcast.net> wrote:

> Obviously there is more to doing this than just adding the lines,
> characters and numbers.  Is there a recommended text, particularly
> for Lisp, for coming up to speed on win32 GDI?

Many people recommend this book:

  <http://www.charlespetzold.com/pw5/index.html>

It talks about bare C, not C++ or any MFC stuff. This is good because
you'll need the C interface if you use it from C.

Corman Lisp comes with a couple of examples which were translated
directly from this book into Lisp.

See also <http://cl-cookbook.sourceforge.net/win32.html>.

Edi.
From: Edi Weitz
Subject: Re: Windows Question
Date: 
Message-ID: <87k794bwz5.fsf@bird.agharta.de>
On 23 Aug 2003 10:22:50 +0200, Edi Weitz <···@agharta.de> wrote:

> It talks about bare C, not C++ or any MFC stuff. This is good
> because you'll need the C interface if you use it from C.
                                      ^^^^^^^^^^^^^^^^^^^^

Hmm, that should have been "if you use it from Lisp", obviously.
From: Steve Graham
Subject: Re: Windows Question
Date: 
Message-ID: <3F46E31B.4080409@comcast.net>
Guess I should have said up front that the app is crossword puzzles ;-) 
 BTW, does Corman 1) Provide examples of GDI calls; and 2) Create an .EXE?


Thanks, again.  Steve Graham

===

Kenny Tilton wrote:

>
>
> Steve Graham wrote:
>
>> I have a Windows project in which I need to:
>> 1) Draw a grid on the screen;
>> 2) Completely blacken out some of the square;
>> 3) In some of the non-blackened out squares put a small number in the 
>> top left or right corner; and
>> 4) In some of the non-blackened out squares put a letter which 
>> occupies most of the space.
>>
>> I have not done any real Windows programming, so this is maybe quite 
>> easily done.  I'm wondering if this is doable in any commercial or 
>> non-commercial version of Lisp.
>
>
> Sure, but you'll be drawing the boxes and placing the characters and 
> the letter numbers yourself, by thinking out the coordinates. Easy 
> stuff once you think about it. The only tricky part is the win32 GDI 
> graphics library you have to go thru. ACL and LW are pricey, but offer 
> Lisp wrappers for the win32 GDI (I mean, a framework which closely 
> parallels but hides the GDI). ACL and CormanCL (less pricey) also 
> provide true wrappers for GDI calls. ie, the calls are the same as the 
> GDI calls, thx to FFI bindings to the actual GDI functions.
>
> But you still have to think about font size info and the GDI 
> coordinate system, but there is glue also to the font info, and the 
> coordinate system is manageable.
>
> Now check out:
>
>    http://www.tilton-technology.com/Acrostic.html
>
> ...and try not to drool on your keyboard. :) That is an ACL project 
> which uses my Cells software. It might port to Corman with a lot of 
> cursing.
>
>
>
From: Kenny Tilton
Subject: Re: Windows Question
Date: 
Message-ID: <3F46F369.40909@nyc.rr.com>
Steve Graham wrote:
> Guess I should have said up front that the app is crossword puzzles ;-) 

I am stunned! :)

> BTW, does Corman 1) Provide examples of GDI calls; and 2) Create an .EXE?

Yes and yes. If you can afford ACL (big job) go with that, otherwise 
you'll do OK with Corman.

As for doing the Win32 with Lisp, heck, a friend once recommended 
Appleman's Visual Basic for Win32. He wasn't wrong. Appleman does a 
great job, and it really is not about VB, and once you grok win32 and 
its GDI, the only question is "do I have Lisp bindings to those GDI 
calls". As I said, Corman does perty good at that, and if you get ACL or 
LW you get Lisp libraries which obviously map almost directly onto the 
GDI stuff, but are really Lisp so you do not even have to think about MS 
and C.

btw, Petzold is legendary on the GDI, and I like Rector and Newcomb. Or 
just find the on-line doc at MSDN--pretty comprehensive.

Food for thought: if you think you are going to be spending more than a 
few weeks with CL, seriously consider LW or even the Cadillac, ACL. I do 
not know how highly you value your time, but those two (esp. ACL) are 
totally worth their $$$ and more.



-- 

  kenny tilton
  clinisys, inc
  http://www.tilton-technology.com/
  ---------------------------------------------------------------
"Career highlights? I had two. I got an intentional walk from
Sandy Koufax and I got out of a rundown against the Mets."
                                                  -- Bob Uecker
From: Russell Wallace
Subject: Re: Windows Question
Date: 
Message-ID: <3f4acf47.53419640@news.eircom.net>
On Sat, 23 Aug 2003 04:50:30 GMT, Kenny Tilton <·······@nyc.rr.com>
wrote:

>Food for thought: if you think you are going to be spending more than a 
>few weeks with CL, seriously consider LW or even the Cadillac, ACL. I do 
>not know how highly you value your time, but those two (esp. ACL) are 
>totally worth their $$$ and more.

I'm curious, what do LW or ACL provide that's worth the extra money?
(Thus far I've looked at the trial version of Corman Lisp, which
looked good.)

-- 
"Sore wa himitsu desu."
To reply by email, remove
the small snack from address.
http://www.esatclear.ie/~rwallace
From: Ng Pheng Siong
Subject: Re: Windows Question
Date: 
Message-ID: <bieisi$opp$1@mawar.singnet.com.sg>
According to Russell Wallace <················@eircom.net>:
> I'm curious, what do LW or ACL provide that's worth the extra money?
> (Thus far I've looked at the trial version of Corman Lisp, which
> looked good.)

I played with the Corman Lisp eval. The IDE is a bit uncomfortable and I
imagine I will use Emacs + ilisp to drive it for real. 

I have a commercial LW Windows license and IMHO its IDE beats Emacs + ilisp
easily. 


-- 
Ng Pheng Siong <····@netmemetic.com> 

http://firewall.rulemaker.net  -+- Manage Your Firewall Rulebase Changes
http://www.post1.com/home/ngps -+- Open Source Python Crypto & SSL
From: Edi Weitz
Subject: Re: Windows Question
Date: 
Message-ID: <877k503ghy.fsf@bird.agharta.de>
On 26 Aug 2003 03:06:58 GMT, ····@netmemetic.com (Ng Pheng Siong) wrote:

> I played with the Corman Lisp eval. The IDE is a bit uncomfortable
> and I imagine I will use Emacs + ilisp to drive it for real.

If you succeed in using this combination you might want to add that to

  <http://cl-cookbook.sourceforge.net/windows.html>.

AFAIK, many people have tried but didn't succeed (or only partially).

Edi.
From: Doug Tolton
Subject: Re: Windows Question
Date: 
Message-ID: <1ffd32d9.0308262324.75af1a44@posting.google.com>
Edi Weitz <···@agharta.de> wrote in message news:<··············@bird.agharta.de>...
> On 26 Aug 2003 03:06:58 GMT, ····@netmemetic.com (Ng Pheng Siong) wrote:
> 
> > I played with the Corman Lisp eval. The IDE is a bit uncomfortable
> > and I imagine I will use Emacs + ilisp to drive it for real.
> 
> If you succeed in using this combination you might want to add that to
> 
>   <http://cl-cookbook.sourceforge.net/windows.html>.
> 
> AFAIK, many people have tried but didn't succeed (or only partially).
> 
> Edi.

Edi, what do you mean by that specifically?  Have people had trouble
using Corman + Emacs + Ilisp for "real" development, or do you mean
they've had trouble getting it set up period?  I have it running on my
windows machine with Emacs + ilisp without any problems.  I believe my
setup very closely mirrors the one setout in the cookbook.  The one
thing I haven't tried to do is GUI or GDI development.  Of course I
haven't really tried that in any IDE other than playing around with
ACL (incidentally using Emacs also).

Doug Tolton
From: Edi Weitz
Subject: Re: Windows Question
Date: 
Message-ID: <87smnnpl1c.fsf@bird.agharta.de>
On 27 Aug 2003 00:24:46 -0700, ·······@yahoo.com (Doug Tolton) wrote:

> Edi, what do you mean by that specifically?  Have people had trouble
> using Corman + Emacs + Ilisp for "real" development, or do you mean
> they've had trouble getting it set up period? 

The latter. My latest info is that a few people (including me)
succeded partially but not to a point where they could really use the
ILISP/Corman combo to do anything substantial. You might want to check
the 2003 archives of the Corman Lisp mailing list and the ILISP
mailing list for pointers. Here's what I got before I gave up:

  <http://groups.yahoo.com/group/cormanlisp/message/1173>
  <http://groups.yahoo.com/group/cormanlisp/message/1175>

> I have it running on my windows machine with Emacs + ilisp without
> any problems.  I believe my setup very closely mirrors the one
> setout in the cookbook.

But the cookbook only describes how to use Corman Lisp with Emacs'
"Inferior Lisp" mode. If you're using it with ILISP I'd be happy to
know details (and add them to the cookbook).

Thanks,
Edi.
From: Doug Tolton
Subject: Re: Windows Question
Date: 
Message-ID: <b57skvgtd1jlkcel5imnhqfh61c7gqv44q@4ax.com>
On 27 Aug 2003 10:22:23 +0200, Edi Weitz <···@agharta.de> wrote:

>But the cookbook only describes how to use Corman Lisp with Emacs'
>"Inferior Lisp" mode. If you're using it with ILISP I'd be happy to
>know details (and add them to the cookbook).

I see, you are correct I'm using it in "Inferior Lisp" mode.

So what is the difference with ILISP versus Inferior Lisp mode?  I
guess I haven't ever set it up using ILISP then.


Doug Tolton
(format t ···@~a~a.~a" "dtolton" "ya" "hoo" "com")
From: Doug Tolton
Subject: Re: Windows Question
Date: 
Message-ID: <2b7skv4inrdevbokcfordm3qe2pbu03r5m@4ax.com>
On 27 Aug 2003 10:22:23 +0200, Edi Weitz <···@agharta.de> wrote:

Correction to my previous post, I have CLISP running in ILISP and
Cormon running in Inferior Lisp mode.  Although I still don't really
understand the difference.  Could someone illuminate me?


Doug Tolton
(format t ···@~a~a.~a" "dtolton" "ya" "hoo" "com")
From: Ng Pheng Siong
Subject: Re: Windows Question
Date: 
Message-ID: <bigv8f$2lu$1@reader01.singnet.com.sg>
According to Edi Weitz  <···@agharta.de>:
> On 26 Aug 2003 03:06:58 GMT, ····@netmemetic.com (Ng Pheng Siong) wrote:
> > I played with the Corman Lisp eval. The IDE is a bit uncomfortable
> > and I imagine I will use Emacs + ilisp to drive it for real.
> 
> If you succeed in using this combination you might want to add that to
> 
>   <http://cl-cookbook.sourceforge.net/windows.html>.

Heh. I said "I imagine..." ;-)

> AFAIK, many people have tried but didn't succeed (or only partially).

I think I'm unlikely to be able to do it.


-- 
Ng Pheng Siong <····@netmemetic.com> 

http://firewall.rulemaker.net  -+- Manage Your Firewall Rulebase Changes
http://www.post1.com/home/ngps -+- Open Source Python Crypto & SSL
From: Kenny Tilton
Subject: Re: Windows Question
Date: 
Message-ID: <3F4B7C04.4020308@nyc.rr.com>
Russell Wallace wrote:
> On Sat, 23 Aug 2003 04:50:30 GMT, Kenny Tilton <·······@nyc.rr.com>
> wrote:
> 
> 
>>Food for thought: if you think you are going to be spending more than a 
>>few weeks with CL, seriously consider LW or even the Cadillac, ACL. I do 
>>not know how highly you value your time, but those two (esp. ACL) are 
>>totally worth their $$$ and more.
> 
> 
> I'm curious, what do LW or ACL provide that's worth the extra money?

The IDE. And I prefer Allegro Common Lisp from Franz, Inc.  because LW 
makes me use the mouse and menus for everything. I am real hesitant to 
say this kinda stuff, because I am sure that if LW were the only CL on 
my desert island I would get used to it (or figure out a way to get 
stuff via keychords), but I have talked to others who noticed the same 
thing. Come to think of it, not sure I tapped any of its biggest 
fans--maybe they know the shortcuts.

As for Corman:

(apropos 'socket)

Package: COMMON-LISP-USER
     SOCKET (INTERNAL)
NIL

On Allegro there also is a dialog box where I can limit output to 
exported symbols, limit output to any of functions, variables, classes 
and something else I forget, I can up down thru recent searches, I can 
sort by symbol or package or any of the other columns. There are columns 
indicating the package, what the thing is (possibly several), whether 
there is a setter, whether it is exported. This stuff is killer when I 
have a package issue. I can limit search to one package. I can 
rightclick on anything I find and do fun things. Including jump to its 
definition in the source if it is one of mine.

And the other tools work as powerfully and together.

-- 

  kenny tilton
  clinisys, inc
  http://www.tilton-technology.com/
  ---------------------------------------------------------------
"Career highlights? I had two. I got an intentional walk from
Sandy Koufax and I got out of a rundown against the Mets."
                                                  -- Bob Uecker
From: Simon Katz
Subject: Re: Windows Question
Date: 
Message-ID: <bigb21$951pk$1@ID-131024.news.uni-berlin.de>
Kenny Tilton wrote:
> Russell Wallace wrote:
> > I'm curious, what do LW or ACL provide that's worth the extra
> > money?
>
> The IDE. And I prefer Allegro Common Lisp from Franz, Inc.
> because LW makes me use the mouse and menus for everything.
> I am real hesitant to say this kinda stuff, because I am sure
> that if LW were the only CL on my desert island I would get
> used to it (or figure out a way to get stuff via keychords),
> but I have talked to others who noticed the same thing. Come
> to think of it, not sure I tapped any of its biggest fans--maybe
> they know the shortcuts.

Yes, I like to minimize using the mouse too.

If you do this in LW for Windows 4.2:  (*) (**)

(setf (getf (cdr (assoc 'capi-win32-lib::*alt-is-meta-key*
                        capi::*key-style-definitions*))
            :emacs)
      t)

then pressing-and-releasing the ALT key activates the menu bar.

If you have Windows set up to underline the characters within menu
commands that can be used to invoke the commands, this enables you to
get at any menu command by hitting a few keys.

I'm not sure that underlining characters in menu commands is the
Windows default, and I've a feeling it may even vary across different
versions of Windows. With Windows 2000, I think I had to use "Always
show keyboard indicators" in TweakUI.

If you don't have TweakUI, it can easily be found with the help of
Googol.


(*)  Put this in your init file.
     If you are using the Personal Edition, you can't load
     init files, so immediately after startup enter the above
     form in a listener, close the listener, and start up a new
     listener.

(**) This is not supported behaviour -- just something Xanalys
     told me about when I asked. Last I knew they were considering
     providing this functionality officially. I don't know if this
     has made it in to LW 4.3 and unfortunately my licence for the
     beta version expired a few days ago so I can't check.
From: Chris Double
Subject: Re: Windows Question
Date: 
Message-ID: <87ekz7a6p4.fsf@double.double.dynip.com>
Kenny Tilton <·······@nyc.rr.com> writes:

> As for Corman:
> 
> (apropos 'socket)
> 
> Package: COMMON-LISP-USER
>      SOCKET (INTERNAL)
> NIL

Try loading the socket package first. Something like:

  (require 'sockets)

Chris.
-- 
http://www.double.co.nz/cl
From: Kenny Tilton
Subject: Re: Windows Question
Date: 
Message-ID: <3F4C7442.3020401@nyc.rr.com>
Chris Double wrote:
> Kenny Tilton <·······@nyc.rr.com> writes:
> 
> 
>>As for Corman:
>>
>>(apropos 'socket)
>>
>>Package: COMMON-LISP-USER
>>     SOCKET (INTERNAL)
>>NIL
> 
> 
> Try loading the socket package first. Something like:
> 
>   (require 'sockets)

I was a bit obscure there. What I meant was that under Corman you just 
get apropos the CL function. With ACl you get that, plus the groovy 
dialog I described. So this has nothing to do with how much output one 
gets from apropos, but rather the interface to that output.

hmmm... maybe I'll try RoboCells under Corman and see if that socket 
implementation can play nice with the soccer server.

-- 

  kenny tilton
  clinisys, inc
  http://www.tilton-technology.com/
  ---------------------------------------------------------------
"Career highlights? I had two. I got an intentional walk from
Sandy Koufax and I got out of a rundown against the Mets."
                                                  -- Bob Uecker
From: Chris Double
Subject: Re: Windows Question
Date: 
Message-ID: <87y8xfxxjy.fsf@double.double.dynip.com>
Kenny Tilton <·······@nyc.rr.com> writes:

> I was a bit obscure there. What I meant was that under Corman you just
> get apropos the CL function. 

Ahh, I see. I thought you were saying there was no socket
support. Oops.

> hmmm... maybe I'll try RoboCells under Corman and see if that socket
> implementation can play nice with the soccer server.

I did an ACL compatibility layer as well. So if you're using the ACL
socket interface, there shouldn't be much in the way of changes. It's
in a seperate file though: (require 'acl-socket).

Chris.
-- 
http://www.double.co.nz/cl
From: Doug Tolton
Subject: Re: Windows Question
Date: 
Message-ID: <8rvmkvcec10adqbm68i5ltoifd0e84f1ih@4ax.com>
On Sat, 23 Aug 2003 04:50:30 GMT, Kenny Tilton <·······@nyc.rr.com>
wrote:

>Food for thought: if you think you are going to be spending more than a 
>few weeks with CL, seriously consider LW or even the Cadillac, ACL. I do 
>not know how highly you value your time, but those two (esp. ACL) are 
>totally worth their $$$ and more.

When you purchase ACL, do you get the Mac and Linux version also?  I
am interested in purchasing it, but I'm constantly switching back and
forth between Windows, Linux and Mac.  Do you have to buy each
platform separately, or do you get all of them when you purchase it?

In order to get the GDI mapping will the Professional edition work, or
do you need the Enterprise Edition?


Doug Tolton
(format t ···@~a~a.~a" "dtolton" "ya" "hoo" "com")
From: Kenny Tilton
Subject: Re: Windows Question
Date: 
Message-ID: <3F4B8C0E.1060509@nyc.rr.com>
Doug Tolton wrote:
> On Sat, 23 Aug 2003 04:50:30 GMT, Kenny Tilton <·······@nyc.rr.com>
> wrote:
> 
> 
>>Food for thought: if you think you are going to be spending more than a 
>>few weeks with CL, seriously consider LW or even the Cadillac, ACL. I do 
>>not know how highly you value your time, but those two (esp. ACL) are 
>>totally worth their $$$ and more.
> 
> 
> When you purchase ACL, do you get the Mac and Linux version also?  I
> am interested in purchasing it, but I'm constantly switching back and
> forth between Windows, Linux and Mac.  Do you have to buy each
> platform separately, or do you get all of them when you purchase it?

Ouch. I have to correct the record. The ACL I use and love is their 
Win32 version. Last I heard the other versions do not have the same fab 
IDE. You do Emacs/iLisp. But I have a faint recollect that they might be 
working on moving the IDE (or was it Common Graphics (see below)) to 
other platforms? Clearly, check with Franz, I'm lost.

I wager they will also tell you about the licensing (and that one does 
not include the other). But talk to them, tell them what you want to do, 
see what they say.

Me, I would develop on the Win32 version (to get the IDE) and keep the 
code portable, use Emacs/iLisp/cmucl-sbcl elsewhere.

> 
> In order to get the GDI mapping will the Professional edition work, or
> do you need the Enterprise Edition?

Franz of course is your best source. That said, Common Graphics is their 
    GUI dev tool, and that and the GDI bindings come with the Pro edition.

-- 

  kenny tilton
  clinisys, inc
  http://www.tilton-technology.com/
  ---------------------------------------------------------------
"Career highlights? I had two. I got an intentional walk from
Sandy Koufax and I got out of a rundown against the Mets."
                                                  -- Bob Uecker
From: Bill Clementson
Subject: Re: Windows Question
Date: 
Message-ID: <1b3ac8a3.0308262055.2d6477b4@posting.google.com>
Kenny Tilton <·······@nyc.rr.com> wrote in message news:<················@nyc.rr.com>...
> Ouch. I have to correct the record. The ACL I use and love is their 
> Win32 version. Last I heard the other versions do not have the same fab 
> IDE. You do Emacs/iLisp. 

Kenny, are you aware that it doesn't have to be an either/or decision
under Windows? You can use Emacs/ELI as your editor from within the
ACL IDE, you just have to setup Emacs to use ELI and configure the IDE
to use Emacs as the default editor. When configured in this manner,
you get the best of both worlds - the superior editor (Emacs) with
convenient access to the other tools that Franz provides in the IDE.

--
Bill Clementson
From: Wade Humeniuk
Subject: Re: Windows Question
Date: 
Message-ID: <5JC1b.31729$K44.27594@edtnps84>
Here is quick and dirty with the CAPI toolkit and
Lispworks for Windows.  Just a demo, letters are
not quite centered and just random numbers and
letters.  Also redisplay takes a bit as I recalc
font size each time.

Load the code (watch for line breaks you may encounter
in your newsreader) into a file, and load into LW, then
try:

CL-USER 13 > (capi:display (make-instance 'crossword))
#<CROSSWORD "Untitled LispWorks Interface - 6" 20408BCC>

CL-USER 14 >

Try resizing the window.

--->>>>>You can also download the file from my web-site

http://www3.telus.net/public/whumeniu/crosssword.lisp

Wade

;; Start Code

(in-package :cl-user)

(defclass check-pinboard-object (capi:drawn-pinboard-object)
  ((colour :initarg :colour :initform :white)
   (number :initarg :number :initform (format nil "~D" (random 99)))
   (letter :initarg :letter :initform (format nil "~A" (char "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (random
26)))))
  (:default-initargs
   :display-callback 'draw-check))

(defvar *small-check-font* (gp:gf nil "Courier New" :normal :roman 8))

(defun determine-font (pane width height)
  (let ((maximum-font-size
         (loop for font-size upfrom 10
               for font =  (gp:gf nil "Courier New" :normal :roman font-size)
               do
               (multiple-value-bind (left top right bottom)
                     (gp:get-string-extent pane "M" font)
                   (when (> (- bottom top) height)
                     (return (1- font-size)))))))
    (gp:gf nil "Courier New" :normal :roman maximum-font-size)))

(defun draw-check (pane check x y width height)
  (with-slots (colour number letter) check
    (gp:draw-rectangle pane x y width height :foreground colour :filled t)
    (when (eq colour :white)
      (gp:draw-string pane number x (+ y (gp:get-char-ascent pane #\A *small-check-font*)) :font
*small-check-font*)
      (let ((large-font (determine-font pane width height)))
        (gp:draw-string pane letter x (+ y (gp:get-char-ascent pane #\A large-font)) :font
large-font)))))

(capi:define-interface crossword ()
  ((rows :initarg :rows :initform 10)
   (columns :initarg :columns :initform 10))
  (:layouts
   (main capi:simple-pinboard-layout '(grid))
   (grid capi:grid-layout
         (loop for i from 0 below (* rows columns)
               collect (make-instance 'check-pinboard-object :colour (nth (random 2) '(:white
:black))))
         :rows rows :columns columns
         :x-uniform-size-p t
         :y-uniform-size-p t))
  (:default-initargs
   :min-width 300
   :min-height 300))
From: Wade Humeniuk
Subject: Re: Windows Question
Date: 
Message-ID: <QMC1b.31825$K44.20502@edtnps84>
> --->>>>>You can also download the file from my web-site
> 
> http://www3.telus.net/public/whumeniu/crosssword.lisp
> 

OOpps that's

http://www3.telus.net/public/whumeniu/crossword.lisp

Wade
From: Greg Menke
Subject: Re: Windows Question
Date: 
Message-ID: <m3zni0k0j8.fsf@europa.pienet>
Steve Graham <·········@comcast.net> writes:

> I have a Windows project in which I need to:
> 1) Draw a grid on the screen;
> 2) Completely blacken out some of the square;
> 3) In some of the non-blackened out squares put a small number in the
> top left or right corner; and
> 4) In some of the non-blackened out squares put a letter which
> occupies most of the space.
> 
> I have not done any real Windows programming, so this is maybe quite
> easily done.  I'm wondering if this is doable in any commercial or
> non-commercial version of Lisp.
> 
> TIA, Steve Graham

I'm doing a similar thing at the moment using the Lispworks CAPI
package, which is framework for developing gui's.  My project is to
draw a calendar where the user selects the month & year, then allows
them to select days and edit associated data.  When the user changes
the month/year, the calendar redraws itself.  Each day is "decorated"
with the day of month and a few display fields, and an edit button.
Its nothing wonderful, but if it would serve as an example I'd be glad
to offer the source.

As I understand it, software that uses CAPI is portable across
Lispworks implementations.  CAPI also uses the host os windowing
features, so my code should generate a Windows-looking app on Windows
as it does a Motif-looking app in Linux.  I've not tried Lispworks on
Windows or Mac yet, so I don't know what the cross-platform weaknesses
or incompatiblities might be, but I don't imagine they'll be
considerable.

Since CAPI is a "full service" library, you won't have to do any OS
drawing calls.  Any drawing you end up doing is thru CAPI functions,
which map to the host os's corresponding functions.  Its a wonderfully
designed framework and exploits Lisp to great effect.

Many of your requirements above could be implemented through using a
heirarchy of controls with the grid panes being "output panes" in
which you can print text of whatever color and font.  The nice thing
about using the heirarchy of controls is the framework will handle
resizing and defaults and other horrid little details, leaving you do
to the drawing you want.

I imagine Allegro and Corman also have their own gui development
frameworks with similar properties, but I've not used them and can't
comment.

Gregm
From: Aleksandr Skobelev
Subject: Re: Windows Question
Date: 
Message-ID: <87ad9z76jm.fsf@mail.ru>
Greg Menke <··········@toadmail.com> writes:

>
> I'm doing a similar thing at the moment using the Lispworks CAPI
> package, which is framework for developing gui's. 

[...]

BTW, I'm wondering, if somebody who is programming with Lispworks
Professional can tell me how good is Lispworks' Interface Builder. Is it
something like the Inerface Builder on Mac or just like a tool for drawing
dialogs in MS Visual C++ IDE?

   Thanks in advance,
   Aleksandr
From: Paul Tarvydas
Subject: Re: Windows Question
Date: 
Message-ID: <SnL2b.47499$_V.32039@news04.bloor.is.net.cable.rogers.com>
Aleksandr Skobelev wrote:
> BTW, I'm wondering, if somebody who is programming with Lispworks
> Professional can tell me how good is Lispworks' Interface Builder. Is it
> something like the Inerface Builder on Mac or just like a tool for drawing
> dialogs in MS Visual C++ IDE?

I can give you some comments.  I use the LW Interface Builder and I've used
VC++.  I have not used Mac's builder - tell me how you perceive it to be
better than VC++.

In general, LW IB looks fairly simplistic at first blush, but, combining it
with CL makes me significantly more productive than with VC++.  Like I
found with Java builders, you have to understand their basic concepts of
how panes and layouts work before you can make good use of IB.  Unlike
Java, CAPI is sane.  I would rate CAPI as one of the top-three sanest /
simplified-est windowing tools that I have encountered (other 2: Sun/OS
prior to OpenLook, Tcl/Tk).

pt
From: John
Subject: Re: Windows Question
Date: 
Message-ID: <opruj84riyfhfgdd@news.chello.no>
On Sat, 23 Aug 2003 01:20:38 GMT, Steve Graham <·········@comcast.net> 
wrote:

> I have a Windows project in which I need to:
> 1) Draw a grid on the screen;
> 2) Completely blacken out some of the square;
> 3) In some of the non-blackened out squares put a small number in the top 
> left or right corner; and
> 4) In some of the non-blackened out squares put a letter which occupies 
> most of the space.
>
> I have not done any real Windows programming, so this is maybe quite 
> easily done.  I'm wondering if this is doable in any commercial or non- 
> commercial version of Lisp.
>
> TIA, Steve Graham
>
>
I think all lisps for windows have a interface to the win32 API which is 
what you need.
There are many different libraries buildt on to of this.
Allegro and liquid lisp are commecial lisps. They have evalation licences.
If you want to keep the lisp with minimum hassle you could try Corman.
Corman's IDE expires after a month, but the lisp core is free and there is 
a emacs interface
which I manged to make work ok.
If you need simplicity you might want to try python (with tkInter) 
intstead..
To my knowlege none of the interfaces are particularly easy to learn.


-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
From: Mario S. Mommer
Subject: Re: Windows Question
Date: 
Message-ID: <fzad9v5njk.fsf@cupid.igpm.rwth-aachen.de>
John <··············@chello.no> writes:
> To my knowlege none of the interfaces are particularly easy to
> learn.

And what is your knowledge, may I ask?
From: Kenny Tilton
Subject: Re: Windows Question
Date: 
Message-ID: <3F4CFB06.5050504@nyc.rr.com>
John wrote:
> On Sat, 23 Aug 2003 01:20:38 GMT, Steve Graham <·········@comcast.net> 
> wrote:
> 
>> I have a Windows project in which I need to:
>> 1) Draw a grid on the screen;
....
> To my knowlege none of the interfaces are particularly easy to learn.

I am surprised to heart that. The ACL Common Graphics GUI seems quite 
simple to learn. You just provide certain callbacks and use the GUI 
builder to design the interface. Sample applications are included. The 
doc includes a tutorial, IIRC.

I hear LW's CAPI is also a pleasure to use, tho I do not recall 
specifics on the learning curve (well, pretty sure I heard it was gentle).



-- 

  kenny tilton
  clinisys, inc
  http://www.tilton-technology.com/
  ---------------------------------------------------------------
"Career highlights? I had two. I got an intentional walk from
Sandy Koufax and I got out of a rundown against the Mets."
                                                  -- Bob Uecker
From: Chris Double
Subject: Re: Windows Question
Date: 
Message-ID: <87u183xr4r.fsf@double.double.dynip.com>
Steve Graham <·········@comcast.net> writes:

> I have not done any real Windows programming, so this is maybe quite
> easily done.  I'm wondering if this is doable in any commercial or
> non-commercial version of Lisp.

This would be doable in any of the commercial Windows Common Lisp
systems and probably the non-commercial ones as well. With all of them
you'd have the choice of doing it with the Windows API
directly. Corman Lisp has a 'Life' example application that could be
used as a start. Allegro CL and Lispworks both have a higher level GUI
framework which would make the job even easier I'd imagine.

Chris.
-- 
http://www.double.co.nz/cl