From whistler at blinksoft.com Sat Sep 1 21:49:39 2007 From: whistler at blinksoft.com (Ken Perry) Date: Sat, 1 Sep 2007 14:49:39 -0700 Subject: [graphic-forms-devel] Half done. Message-ID: <007e01c7ece1$ffd62710$6401a8c0@Aiden> I am half done with my first program with the library but I have ran into a problem that needs fixing before it will work. I am not sure if my last message got to the list but in the flow demo and in the widget-tester demo you can not use tab to go from control to control. I used Microsoft ASM to write my last demo for a group I am on so I know I don't have to do any special event handling to make tab work in regular win32 programs. Is there a reason the tab is not working in the graphic forms library? The windlg seems to allow the tab to work correctly but it doesn't use the flow controls. Also is there a way to put short cuts on menus? I don't' see it in the documentation and the test program Text edit doesn't have them. I understand this is open source so I could help add some of these features if they are wanted but I don't' want to add something that is not wanted. Ken From jdunrue at gmail.com Sat Sep 1 22:35:19 2007 From: jdunrue at gmail.com (Jack Unrue) Date: Sat, 1 Sep 2007 16:35:19 -0600 Subject: [graphic-forms-devel] Accessibility question In-Reply-To: <002301c7eb9f$6ce31fa0$6401a8c0@Aiden> References: <002301c7eb9f$6ce31fa0$6401a8c0@Aiden> Message-ID: On 8/31/07, Ken Perry wrote: > > Jack, > > I just tested your layout tester and found a problem. Is there no tab index > property on the controls? You had asked me about accessibility earlier and > one big part of accessibility for your forms would be to have tab index > working and the ability to add short cut keys. Currently it seems the only > way to use the buttons is to click on them with the mouse for example I have > 4 buttons on the layout tester and can't tab between them and select them > with enter is this true? Or is there a property I have not found in the API > to add keyboard access. Tab traversal logic is not yet implemented for top-level windows and panels. This is logged as bug # 1458481 in the SF.net bug tracker. I suspect I would leave tab traversal off by default in a window, and require the app to enable it. But that's contingent on implementing the required stuff under the hood to make it possible at all. Tab traversal is implemented and enabled by default for dialogs. So perhaps you could consider defining a dialog which would get invoked via a menu item or something like that. Control shortcuts are also not yet implemented -- or at least, I haven't investigated what else needs to be done. You've probably noticed that mnemonics work for menu items. The need to support accelerators is logged as bug # 1458491. -- Jack Unrue From jdunrue at gmail.com Sat Sep 1 22:47:16 2007 From: jdunrue at gmail.com (Jack Unrue) Date: Sat, 1 Sep 2007 16:47:16 -0600 Subject: [graphic-forms-devel] Half done. In-Reply-To: <007e01c7ece1$ffd62710$6401a8c0@Aiden> References: <007e01c7ece1$ffd62710$6401a8c0@Aiden> Message-ID: On 9/1/07, Ken Perry wrote: > > I am half done with my first program with the library but I have ran into a > problem that needs fixing before it will work. I am not sure if my last > message got to the list but in the flow demo and in the widget-tester demo > you can not use tab to go from control to control. See my other reply -- there is a bunch of work yet to be done in these areas. > I used Microsoft ASM to write my last demo for a group I am on so I know > I don't have to do any special event handling to make tab work in regular > win32 programs. My understanding is that at a minimum, one needs to call IsDialogMessage() in order to get the proper tab and arrow key behavior. I do that right now for dialogs (see the function INTERCEPT-KBDNAV-MESSAGE function in thread-context.lisp, and where that's called from in the DEFAULT-MESSAGE-FILTER function in widget-utils.lisp). It's possible that I've take a dialog-specific approach that could be generalized a bit better for any kind of window, so if you have specific ideas about this I'm interested in hearing them. > Is there a reason the tab is not working in the graphic forms library? The > windlg seems to allow the tab to work correctly but it doesn't use the flow > controls. Also is there a way to put short cuts on menus? I don't' see it > in the documentation and the test program Text edit doesn't have them. > > I understand this is open source so I could help add some of these features > if they are wanted but I don't' want to add something that is not wanted. I'd be happy to look at any patches you want to submit. Probably the best thing to do is to upload them using the patch tracker at SF.net. Don't be alarmed if it takes a few iterations before I decide I'm happy enough to apply patches, we'll just take it one step at a time. -- Jack Unrue From whistler at blinksoft.com Mon Sep 3 22:31:23 2007 From: whistler at blinksoft.com (Ken Perry) Date: Mon, 3 Sep 2007 15:31:23 -0700 Subject: [graphic-forms-devel] Looking for example Message-ID: <003d01c7ee7a$292e00d0$6401a8c0@Aiden> I am looking for a simple dialog based program example. All the examples seem to start with a main with menus and when I try to change it so that its just a dialog I get missing dispose events. I am going to go read up on declare because it seems to be the one part of the language that the two manuals I have read on lisp kind of glossed over and it might be part of my problem. If anyone has a simple dialog example with maybe just two buttons even if it does nothing at all but display the two buttons when you run it that would be great. I have one right now that runs and displays a menu but its not just a dialog it runs up in a main frame and I don't need that. Ken From whistler at blinksoft.com Wed Sep 5 05:49:57 2007 From: whistler at blinksoft.com (Ken Perry) Date: Tue, 4 Sep 2007 22:49:57 -0700 Subject: [graphic-forms-devel] Gfw:append-item Message-ID: <007201c7ef80$98195d80$6401a8c0@Aiden> I tried the following: (defun move-txt-content (txt lb) (gfw:append-item lb (truncate-text (gfw:text txt))) It says I don't have the right amount of arguments. I was hoping that the arguments in the Documents were not all required so that I could just add a text string from a gfw:edit to a list box. Now that I know more are required. I am wondering if you can explain to me what I am supposed to put in the event dispatcher argument if I am just moving text from an gfw:edit to a gfw:list-box I am sure its some kind of short lambda function since I don't think there is really anything I need to do unless I am making a more robust application than I am. Any help is very much appreciated. Ken From kperry at blinksoft.com Wed Sep 5 05:57:16 2007 From: kperry at blinksoft.com (Ken Perry) Date: Tue, 4 Sep 2007 22:57:16 -0700 Subject: [graphic-forms-devel] Gfw:append-item In-Reply-To: <007201c7ef80$98195d80$6401a8c0@Aiden> References: <007201c7ef80$98195d80$6401a8c0@Aiden> Message-ID: <007301c7ef81$9e29d5f0$6401a8c0@Aiden> Never mind I found if I pass nil nil to the append function it allows me to do what I want thanks. Ken -----Original Message----- From: graphic-forms-devel-bounces at common-lisp.net [mailto:graphic-forms-devel-bounces at common-lisp.net] On Behalf Of Ken Perry Sent: Tuesday, September 04, 2007 10:50 PM To: graphic-forms-devel at common-lisp.net Subject: [graphic-forms-devel] Gfw:append-item I tried the following: (defun move-txt-content (txt lb) (gfw:append-item lb (truncate-text (gfw:text txt))) It says I don't have the right amount of arguments. I was hoping that the arguments in the Documents were not all required so that I could just add a text string from a gfw:edit to a list box. Now that I know more are required. I am wondering if you can explain to me what I am supposed to put in the event dispatcher argument if I am just moving text from an gfw:edit to a gfw:list-box I am sure its some kind of short lambda function since I don't think there is really anything I need to do unless I am making a more robust application than I am. Any help is very much appreciated. Ken _______________________________________________ graphic-forms-devel mailing list graphic-forms-devel at common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/graphic-forms-devel From whistler at blinksoft.com Thu Sep 6 03:55:15 2007 From: whistler at blinksoft.com (Ken Perry) Date: Wed, 5 Sep 2007 20:55:15 -0700 Subject: [graphic-forms-devel] Size of controls Message-ID: <000601c7f039$bc82cf80$6401a8c0@Aiden> I am using the flow controls to create a dialog. The problem is I am dynamically adding strings to a list-box. The problem is its staying the size of the first string I added. I want to be able to set the width of the list-box but I can't seem to get size or preferred size to work does anyone have an example of a defined list-box with size set. Ken From jdunrue at gmail.com Thu Sep 6 05:05:11 2007 From: jdunrue at gmail.com (Jack Unrue) Date: Wed, 5 Sep 2007 23:05:11 -0600 Subject: [graphic-forms-devel] Size of controls In-Reply-To: <000601c7f039$bc82cf80$6401a8c0@Aiden> References: <000601c7f039$bc82cf80$6401a8c0@Aiden> Message-ID: On 9/5/07, Ken Perry wrote: > > I am using the flow controls to create a dialog. The problem is I am > dynamically adding strings to a list-box. The problem is its staying the > size of the first string I added. I want to be able to set the width of > the list-box but I can't seem to get size or preferred size to work does > anyone have an example of a defined list-box with size set. What you need to do is set the minimum size attribute of the control. For example, if you add the following line to widget-tester.lisp immediately after the make-instance call for lb1 in the populate-list-box-test-panel function (setf (gfw:minimum-size lb1) (gfs:make-size :width 200 :height 150)) this results in the left-hand list box being at least 200 pixels wide. And because of the way this test program is coded, the right-hand list box is also made to be the same width. Now, you'll notice that the list boxes are the same height as they were before this change. That's because the other components of the panels in the window are such that 150 pixels is less than the available vertical space, so the list boxes end up taller than that. -- Jack Unrue From kperry at blinksoft.com Thu Sep 6 05:24:49 2007 From: kperry at blinksoft.com (Ken Perry) Date: Wed, 5 Sep 2007 22:24:49 -0700 Subject: [graphic-forms-devel] Size of controls In-Reply-To: References: <000601c7f039$bc82cf80$6401a8c0@Aiden> Message-ID: <001901c7f046$4004c5a0$6401a8c0@Aiden> Excellent that will fix it. I should probably do that to the edit box because I want to start it empty. I just couldn't find any examples in the demo's for sizing things. Have you ever thought of adding the ability to size by character size? This of course would mean if the character set was changed it might change the size of the over all dialog but that is a good thing I would think? Ken From whistler at blinksoft.com Fri Sep 7 06:17:26 2007 From: whistler at blinksoft.com (Ken Perry) Date: Thu, 6 Sep 2007 23:17:26 -0700 Subject: [graphic-forms-devel] List box not resizing. Message-ID: <000001c7f116$c40e8950$6401a8c0@Aiden> I followed your instructions and added the minimum size I have tried all kinds of values for my controls but what seems to be happening is when the control is initialized it is one size and after I add the first word it is another size but after I add the third word it doesn't get any bigger. What I want is it to start out at the right size and thus not cut off what I add. If you want to see what I mean run the following program and add the fruits in this order Apple Orange Pine Apple Thanks and the following sizes are after trying everything from 200 by 150 to 400 by 300 for the dialog and all kinds of sizes so it might not be the best look but I am just trying to get it to work then I can pretty it up Thanks, Ken ---c:\graphic-forms\src\tests\uitoolkit\fruitbasket.lisp--- (in-package #:graphic-forms.uitoolkit.tests) (defclass fruit-events (gfw:event-dispatcher) ()) (defmethod gfw:event-close ((disp fruit-events) (dlg gfw:dialog)) (call-next-method) (let ((ownerp (gfw:owner dlg))) (gfs:dispose dlg) (unless ownerp (gfw:shutdown 0)))) (defun move-txt-content (txt lb) (gfw:append-item lb (truncate-text (gfw:text txt )) nil nil) (setf (gfw:text txt) "") (gfw:give-focus txt)) (defun remove-item ( lb txt ) (gfw:delete-selection lb) (gfw:give-focus txt)) ; (defun fruit-dlg (title style parent) (let* ((dlg (make-instance 'gfw:dialog :owner parent :dispatcher (make-instance 'fruit-events) :layout (make-instance 'gfw:flow-layout :margins 8 :spacing 8 :style '(:vertical)) :style style :text title)) (edit-disp (make-instance 'edit-control-events)) (top-panel (make-instance 'gfw:panel :layout (make-instance 'gfw:flow-layout :spacing 4 :style '(:vertical)) :parent dlg)) (inner-panel (make-instance 'gfw:panel :layout (make-instance 'gfw:flow-layout :spacing 4 :style '(:horizontal)) :parent dlg)) (fruit-label (make-instance 'gfw:label :text "Fruit:" :parent inner-panel)) (fruit-edit (make-instance 'gfw:edit :text "fffffffffffffffffffffffffffffff" :parent inner-panel)) (fruit-list (make-instance 'gfw:list-box ; :callback (fruit-list-callback) :parent top-panel)) (btn-panel (make-instance 'gfw:panel :layout (make-instance 'gfw:flow-layout :spacing 4 :style '(:horizontal :normalize)) :parent dlg)) (btn-add-callback (lambda (disp btn) (declare (ignore disp btn)) (move-txt-content fruit-edit fruit-list ))) (btn-add (make-instance 'gfw:button :callback btn-add-callback :style '(:default-button) :text "Add" :parent btn-panel)) (btn-remove-callback (lambda (disp btn) (declare (ignore disp btn)) (remove-item fruit-list fruit-edit))) (btn-remove (make-instance 'gfw:button :callback btn-remove-callback :style '(:default-button) :text "Remove" :parent btn-panel)) (btn-exit (make-instance 'gfw:button :callback (lambda (disp btn) (declare (ignore disp btn)) (let ((ownerp (gfw:owner dlg))) (gfs:dispose dlg) (unless ownerp (gfw:shutdown 0)))) :style '(:cancel-button) :text "Exit" :parent btn-panel))) (declare (ignore fruit-label btn-add btn-remove btn-exit)) (setf (gfw:minimum-size fruit-list) (gfs:make-size :width 300 :height 77)) (setf (gfw:minimum-size dlg) (gfs:make-size :width 400 :height 300 )) (setf (gfw:minimum-size fruit-label) (gfs:make-size :width 50 :height 23)) (setf (gfw:minimum-size fruit-edit) (gfs:make-size :width 120 :height 23)) (setf (gfw:minimum-size fruit-list) (gfs:make-size :width 300 :height 77)) (gfw:pack dlg) (setf (gfw:text fruit-edit) "") (gfw:show dlg t) dlg)) (defun fruit-basket-main () (fruit-dlg "Lisp Fruit basket demo" '(:appli) nil) ) (defun fruitbasket () (gfw:startup "Window/Dialog Tester" #'fruit-basket-main)) From kperry at blinksoft.com Fri Sep 7 06:24:10 2007 From: kperry at blinksoft.com (Ken Perry) Date: Thu, 6 Sep 2007 23:24:10 -0700 Subject: [graphic-forms-devel] List box not resizing. In-Reply-To: <000001c7f116$c40e8950$6401a8c0@Aiden> References: <000001c7f116$c40e8950$6401a8c0@Aiden> Message-ID: <000101c7f117$b4e81940$6401a8c0@Aiden> Sorry the previous one I sent had a small error I didn't have the inner layout manager with the correct parent so here it is again: (in-package #:graphic-forms.uitoolkit.tests) (defclass fruit-events (gfw:event-dispatcher) ()) (defmethod gfw:event-close ((disp fruit-events) (dlg gfw:dialog)) (call-next-method) (let ((ownerp (gfw:owner dlg))) (gfs:dispose dlg) (unless ownerp (gfw:shutdown 0)))) (defun move-txt-content (txt lb) (gfw:append-item lb (truncate-text (gfw:text txt )) nil nil) (setf (gfw:text txt) "") (gfw:give-focus txt)) (defun remove-item ( lb txt ) (gfw:delete-selection lb) (gfw:give-focus txt)) ; (defun fruit-dlg (title style parent) (let* ((dlg (make-instance 'gfw:dialog :owner parent :dispatcher (make-instance 'fruit-events) :layout (make-instance 'gfw:flow-layout :margins 8 :spacing 8 :style '(:vertical)) :style style :text title)) (edit-disp (make-instance 'edit-control-events)) (top-panel (make-instance 'gfw:panel :layout (make-instance 'gfw:flow-layout :spacing 4 :style '(:vertical)) :parent dlg)) (inner-panel (make-instance 'gfw:panel :layout (make-instance 'gfw:flow-layout :spacing 4 :style '(:horizontal)) :parent top-panel)) (fruit-label (make-instance 'gfw:label :text "Fruit:" :parent inner-panel)) (fruit-edit (make-instance 'gfw:edit :text "fffffffffffffffffffffffffffffff" :parent inner-panel)) (fruit-list (make-instance 'gfw:list-box ; :callback (fruit-list-callback) :parent top-panel)) (btn-panel (make-instance 'gfw:panel :layout (make-instance 'gfw:flow-layout :spacing 4 :style '(:horizontal :normalize)) :parent dlg)) (btn-add-callback (lambda (disp btn) (declare (ignore disp btn)) (move-txt-content fruit-edit fruit-list ))) (btn-add (make-instance 'gfw:button :callback btn-add-callback :style '(:default-button) :text "Add" :parent btn-panel)) (btn-remove-callback (lambda (disp btn) (declare (ignore disp btn)) (remove-item fruit-list fruit-edit))) (btn-remove (make-instance 'gfw:button :callback btn-remove-callback :style '(:default-button) :text "Remove" :parent btn-panel)) (btn-exit (make-instance 'gfw:button :callback (lambda (disp btn) (declare (ignore disp btn)) (let ((ownerp (gfw:owner dlg))) (gfs:dispose dlg) (unless ownerp (gfw:shutdown 0)))) :style '(:cancel-button) :text "Exit" :parent btn-panel))) (declare (ignore fruit-label btn-add btn-remove btn-exit)) (setf (gfw:minimum-size fruit-list) (gfs:make-size :width 300 :height 77)) (setf (gfw:minimum-size dlg) (gfs:make-size :width 400 :height 300 )) (setf (gfw:minimum-size fruit-label) (gfs:make-size :width 50 :height 23)) (setf (gfw:minimum-size fruit-edit) (gfs:make-size :width 120 :height 23)) (setf (gfw:minimum-size fruit-list) (gfs:make-size :width 300 :height 77)) (gfw:pack dlg) (setf (gfw:text fruit-edit) "") (gfw:show dlg t) dlg)) (defun fruit-basket-main () (fruit-dlg "Lisp Fruit basket demo" '(:appli) nil) ) (defun fruitbasket () (gfw:startup "Window/Dialog Tester" #'fruit-basket-main)) From whistler at blinksoft.com Fri Sep 7 09:25:30 2007 From: whistler at blinksoft.com (Ken Perry) Date: Fri, 7 Sep 2007 02:25:30 -0700 Subject: [graphic-forms-devel] Fixed my stupid listbox layout problem Message-ID: <000501c7f131$09b225b0$6401a8c0@Aiden> Please disregard my layout question. It was one of the banes of coding I blocked and copied a function and didn't even notice it was there. I had a truncate function shortening the string so it wasn't even the lay out manager or the size of the controls causing the problem. Thanks, Ken From whistler at blinksoft.com Fri Sep 7 19:53:30 2007 From: whistler at blinksoft.com (Ken Perry) Date: Fri, 7 Sep 2007 12:53:30 -0700 Subject: [graphic-forms-devel] Dialog focus Message-ID: <000601c7f188$c49ae400$6401a8c0@Aiden> I have just looked through the documentation for a way to set the initial focused control but have not found one. I could create a focus event that said if the dlg gets focus then focus the one I want but I am wondering if there is another way like for example a :default-focus for the dlg? I add a listbox to the dialog then an edit box and then 3 buttons. It seems no matter if I add the edit box first or last or in the middle some where The dialog when shown always seems to focus the list box which I don't understand why that is. Any ideas are greatly appreciated. Ken From jdunrue at gmail.com Sat Sep 8 04:55:59 2007 From: jdunrue at gmail.com (Jack Unrue) Date: Fri, 7 Sep 2007 22:55:59 -0600 Subject: [graphic-forms-devel] Dialog focus In-Reply-To: <000601c7f188$c49ae400$6401a8c0@Aiden> References: <000601c7f188$c49ae400$6401a8c0@Aiden> Message-ID: On 9/7/07, Ken Perry wrote: > > I have just looked through the documentation for a way to set the initial > focused control but have not found one. I could create a focus event that > said if the dlg gets focus then focus the one I want but I am wondering if > there is another way like for example a :default-focus for the dlg? I add a > listbox to the dialog then an edit box and then 3 buttons. It seems no > matter if I add the edit box first or last or in the middle some where The > dialog when shown always seems to focus the list box which I don't > understand why that is. Hi Ken. Try calling gfw:give-focus on the desired control in your initialization of the dialog. One thing that I haven't decided whether I'm happy about is the behavior that occurs when any control has the focus and one switches to another window and then back. I find that I have to manually set the focus back, when one might expect that when the window is made active again, that the control that previously had focus would remember that state. I need to do some research and see if this is just normal Win32 behavior, and if it is, then I might think about providing some mechanism to handle this automatically. Your input is welcome. -- Jack Unrue From jdunrue at gmail.com Sat Sep 8 04:59:26 2007 From: jdunrue at gmail.com (Jack Unrue) Date: Fri, 7 Sep 2007 22:59:26 -0600 Subject: [graphic-forms-devel] Size of controls In-Reply-To: <001901c7f046$4004c5a0$6401a8c0@Aiden> References: <000601c7f039$bc82cf80$6401a8c0@Aiden> <001901c7f046$4004c5a0$6401a8c0@Aiden> Message-ID: On 9/5/07, Ken Perry wrote: > > Excellent that will fix it. I should probably do that to the edit box > because I want to start it empty. I just couldn't find any examples in > the demo's for sizing things. > > Have you ever thought of adding the ability to size by character size? This > of course would mean if the character set was changed it might change the > size of the over all dialog but that is a good thing I would think? That's an interesting thought, and although I can't remember specifically right now, it seems like I recall at least one other GUI framework that provides something like that. Would you mind adding an enhancement request to the SourceForge tracker? Thanks! -- Jack Unrue From kperry at blinksoft.com Sat Sep 8 05:53:48 2007 From: kperry at blinksoft.com (Ken Perry) Date: Fri, 7 Sep 2007 22:53:48 -0700 Subject: [graphic-forms-devel] Dialog focus In-Reply-To: References: <000601c7f188$c49ae400$6401a8c0@Aiden> Message-ID: <001d01c7f1dc$a171aff0$6401a8c0@Aiden> I didn't even realize it didn't keep the correct focus when the application loses focus till you just wrote this. I can tell you this is not how Win32 normally works. If you would like I can send you both an EXE and an ASM win32 program that does the same thing as my lisp program which I am writing in your graphic-forms library. That way you could test how a pure win32 application works against your library if you like. If you want I can send my newest lisp file, my ASM file, and the EXE of the ASM file. If you don't trust that I am sending you just the simple program and I might not in your place I can also zip up the GOASM compiler and linker in the directory so you can make the ASM file for safety sake. I have a simple bat file that makes it so you don't have to fight learning to use the asm compiler and linker if you haven't used GoAsm before. As for fixing it you could make a global *current-control-focused* or something like it so that when it returns and the activated event is called you can reset the focus. Well let me know if you would like to see the comparison and I will zip it all up. Ken -----Original Message----- From: graphic-forms-devel-bounces at common-lisp.net [mailto:graphic-forms-devel-bounces at common-lisp.net] On Behalf Of Jack Unrue Sent: Friday, September 07, 2007 9:56 PM To: graphic-forms-devel at common-lisp.net Subject: Re: [graphic-forms-devel] Dialog focus On 9/7/07, Ken Perry wrote: > > I have just looked through the documentation for a way to set the > initial focused control but have not found one. I could create a > focus event that said if the dlg gets focus then focus the one I want > but I am wondering if there is another way like for example a > :default-focus for the dlg? I add a listbox to the dialog then an > edit box and then 3 buttons. It seems no matter if I add the edit box > first or last or in the middle some where The dialog when shown > always seems to focus the list box which I don't understand why that is. Hi Ken. Try calling gfw:give-focus on the desired control in your initialization of the dialog. One thing that I haven't decided whether I'm happy about is the behavior that occurs when any control has the focus and one switches to another window and then back. I find that I have to manually set the focus back, when one might expect that when the window is made active again, that the control that previously had focus would remember that state. I need to do some research and see if this is just normal Win32 behavior, and if it is, then I might think about providing some mechanism to handle this automatically. Your input is welcome. -- Jack Unrue _______________________________________________ graphic-forms-devel mailing list graphic-forms-devel at common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/graphic-forms-devel From jdunrue at gmail.com Sat Sep 8 21:40:06 2007 From: jdunrue at gmail.com (Jack Unrue) Date: Sat, 8 Sep 2007 15:40:06 -0600 Subject: [graphic-forms-devel] Dialog focus In-Reply-To: <001d01c7f1dc$a171aff0$6401a8c0@Aiden> References: <000601c7f188$c49ae400$6401a8c0@Aiden> <001d01c7f1dc$a171aff0$6401a8c0@Aiden> Message-ID: On 9/7/07, Ken Perry wrote: > > I didn't even realize it didn't keep the correct focus when the application > loses focus till you just wrote this. I can tell you this is not how Win32 > normally works. If you would like I can send you both an EXE and an ASM > win32 program that does the same thing as my lisp program which I am writing > in your graphic-forms library. That way you could test how a pure win32 > application works against your library if you like. If you want I can send > my newest lisp file, my ASM file, and the EXE of the ASM file. If you don't > trust that I am sending you just the simple program and I might not in your > place I can also zip up the GOASM compiler and linker in the directory so > you can make the ASM file for safety sake. I have a simple bat file that > makes it so you don't have to fight learning to use the asm compiler and > linker if you haven't used GoAsm before. Well, I can certainly whip up a C-based Win32 app and explore this further, I just haven't done that yet. > As for fixing it you could make a global *current-control-focused* or > something like it so that when it returns and the activated event is called > you can reset the focus. I suspect the fix involves some additional window style or event handling behavior that is missing. I'll do some research, as mentioned above. Manually tracking focused controls (remember, an application may have multiple windows), whether that's done by the application or by Graphic-Forms, strikes me as the wrong solution. > Well let me know if you would like to see the comparison and I will zip it > all up. I don't think that will be necessary, but if I change my mind, I'll let you know. Thanks! -- Jack Unrue From kperry at blinksoft.com Sun Sep 9 00:10:41 2007 From: kperry at blinksoft.com (Ken Perry) Date: Sat, 8 Sep 2007 17:10:41 -0700 Subject: [graphic-forms-devel] Dialog focus In-Reply-To: References: <000601c7f188$c49ae400$6401a8c0@Aiden><001d01c7f1dc$a171aff0$6401a8c0@Aiden> Message-ID: <007801c7f275$dcfbbf90$6401a8c0@Aiden> You said, "Well, I can certainly whip up a C-based Win32 app and explore this further, I just haven't done that yet." Nod well I have this program in c, c++ and well just about every language its one reason we do it in all these languages so we can see how each work differently for the same task. So the offer still stands if you just want a version of the same program sample. you said, "I suspect the fix involves some additional window style or event handling behavior that is missing. I'll do some research, as mentioned above." I don't know what other event handling you would need to do. What I t looks like is your flow panels are taking the focus the default action of Win32 is to keep the location when you go back. I didn't have to do anything at all but write the add and delete functions and the focus stayed where it was supposed to. So I am thinking it has to be some code you have in the activated event base graphic-forms lisp code. You said, "Manually tracking focused controls (remember, an application may have multiple windows), whether that's done by the application or by Graphic-Forms, strikes me as the wrong solution." Your right of course I totally was not thinking when I sent that answer. I am going to have a look through your code just to get a feel for how it works. Up till now I was only looking in your API documentation to get my small dialog based app working. One thing I found missing in your docs are examples. Your chm is fine for old time coders but for beginners in the language it doesn't give an example call for functions which would be helpful. Ken From whistler at blinksoft.com Sun Sep 9 16:01:15 2007 From: whistler at blinksoft.com (Ken Perry) Date: Sun, 9 Sep 2007 09:01:15 -0700 Subject: [graphic-forms-devel] Layout workings? Message-ID: <002101c7f2fa$a79e1750$6401a8c0@Aiden> First I realize this is in alpha so if the answer is the layout mangier is not working fully that is fine. I just want to know how this is supposed to work. I have created a top level layout mangier that is vertical. inside it I have put a layout mangier that is horizontal and has an label and edit box and separately inside the top level under the first one I have put in a list box. Then finally I put another horizontal layout mangier under the list box that has 3 buttons. So I think what I should get is a row with label and edit box and a second row with the list box and a third row with 3 buttons. If I understand it correctly it should grow the list box to be as long as my edit box and label together. Then finally make the buttons at the bottom all the same length of the longest row. If that is how it is supposed to work it is not. My list box is not the same length as the edit box let alone the edit box and label together. Can you take a look at this and tell me what I should be doing to line these controls up in this dialog? (defclass fruit-events (gfw:event-dispatcher) ()) (defmethod gfw:event-close ((disp fruit-events) (dlg gfw:dialog)) (call-next-method) (let ((ownerp (gfw:owner dlg))) (gfs:dispose dlg) (unless ownerp (gfw:shutdown 0)))) (defun fruit-basket () (gfw:startup "Fruit basket" (lambda () (let* ((dlg (make-instance 'gfw:dialog :owner nil :dispatcher (make-instance 'fruit-events) :layout (make-instance 'gfw:flow-layout :margins 8 :spacing 8 :style '(:vertical)) :style :modeless :text "Fruit basket LISP demonstration")) ; (edit-disp (make-instance 'edit-control-events)) (top-panel (make-instance 'gfw:panel :layout (make-instance 'gfw:flow-layout :spacing 4 :style '(:vertical)) :parent dlg)) (inner-panel (make-instance 'gfw:panel :layout (make-instance 'gfw:flow-layout :spacing 4) :parent top-panel)) (fruit-list (make-instance 'gfw:list-box ;:callback (fruit-list-callback) :parent top-panel)) (fruit-label (make-instance 'gfw:label :text "Enter fruit:" :parent inner-panel)) (fruit-edit (make-instance 'gfw:edit :text "1234567890123456789012345" :parent inner-panel)) (btn-panel (make-instance 'gfw:panel :layout (make-instance 'gfw:flow-layout :spacing 4) :parent top-panel )) (btn-add (make-instance 'gfw:button :callback (lambda (disp btn ) (declare (ignore disp btn)) (gfw:append-item fruit-list (gfw:text fruit-edit ) nil nil) (setf (gfw:text fruit-edit) "") (gfw:give-focus fruit-edit)) :style '(:default-button) :text "Add" :parent btn-panel)) (btn-remove (make-instance 'gfw:button :callback (lambda (disp btn) (declare (ignore disp btn)) (gfw:delete-selection fruit-list) (gfw:give-focus fruit-edit)) :style '(:default-button) :text "Remove" :parent btn-panel)) (btn-exit (make-instance 'gfw:button :callback (lambda (disp btn) (declare (ignore disp btn)) (let ((ownerp (gfw:owner dlg))) (gfs:dispose dlg) (unless ownerp (gfw:shutdown 0)))) :style '(:cancel-button) :text "Exit" :parent btn-panel))) (declare (ignore fruit-label btn-add btn-remove btn-exit)) (gfw:pack dlg) (setf (gfw:minimum-size dlg) (gfs:make-size :width 300 :height 200 )) (setf (gfw:text fruit-edit) "") (gfw:show dlg t) dlg)))) From whistler at blinksoft.com Mon Sep 10 20:04:56 2007 From: whistler at blinksoft.com (Ken Perry) Date: Mon, 10 Sep 2007 13:04:56 -0700 Subject: [graphic-forms-devel] Problems with dialogs Message-ID: <003a01c7f3e5$dcb92510$6401a8c0@Aiden> Since I was having trouble with the layouts looking right I decided to try to make the program with out a layout mangier. If you run this and maximize the dialog you will see that it all lies up now. Now I am having a different problem though it seems with out the layout mangier I lose the default buttons. I have the btn-add set to be the default button but when I hit enter on the edit box it gives me a warning and does nothing. Did I do the default button correctly? The following is the running code: (defclass fruit-events (gfw:event-dispatcher) ()) (defmethod gfw:event-close ((disp fruit-events) (dlg gfw:dialog)) (call-next-method) (let ((ownerp (gfw:owner dlg))) (gfs:dispose dlg) (unless ownerp (gfw:shutdown 0)))) (defun fruit-basket-nl () (gfw:startup "Fruit basket" (lambda () (let* ((dlg (make-instance 'gfw:dialog :owner nil :dispatcher (make-instance 'fruit-events) :style :modeless :text "Fruit basket LISP demonstration")) (fruit-list (make-instance 'gfw:list-box ;:callback (fruit-list-callback) :parent dlg)) (fruit-label (make-instance 'gfw:label :text "Enter fruit:" :parent dlg)) (fruit-edit (make-instance 'gfw:edit :text "" :parent dlg)) (btn-add (make-instance 'gfw:button :style '(:default-button) :callback (lambda (disp btn ) (declare (ignore disp btn)) (gfw:append-item fruit-list (gfw:text fruit-edit ) nil nil) (setf (gfw:text fruit-edit) "") (gfw:give-focus fruit-edit)) :style '(:default-button) :text "Add" :parent dlg)) (btn-remove (make-instance 'gfw:button :callback (lambda (disp btn) (declare (ignore disp btn)) (gfw:delete-selection fruit-list) (gfw:give-focus fruit-edit)) :style '(:default-button) :text "Remove" :parent dlg)) (btn-exit (make-instance 'gfw:button :callback (lambda (disp btn) (declare (ignore disp btn)) (let ((ownerp (gfw:owner dlg))) (gfs:dispose dlg) (unless ownerp (gfw:shutdown 0)))) :style '(:cancel-button) :text "Exit" :parent dlg))) (declare (ignore fruit-label btn-add btn-remove btn-exit)) (setf (gfw:minimum-size dlg) (gfs:make-size :width 186 :height 141 )) (setf (gfw:location fruit-label) (gfs:make-point :x 6 :y 6 )) (setf (gfw:size fruit-label) (gfs:make-size :width 50 :height 23 )) (setf (gfw:location fruit-edit) (gfs:make-point :x 60 :y 6 )) (setf (gfw:size fruit-edit) (gfs:make-size :width 120 :height 23 )) (setf (gfw:location fruit-list) (gfs:make-point :x 33 :y 33 )) (setf (gfw:size fruit-list) (gfs:make-size :width 120 :height 77 )) (setf (gfw:location btn-add) (gfs:make-point :x 6 :y 114 )) (setf (gfw:size btn-add) (gfs:make-size :width 55 :height 23 )) (setf (gfw:location btn-remove) (gfs:make-point :x 65 :y 114 )) (setf (gfw:size btn-remove) (gfs:make-size :width 56 :height 23 )) (setf (gfw:location btn-exit) (gfs:make-point :x 125 :y 114 )) (setf (gfw:size btn-exit) (gfs:make-size :width 55 :height 23 )) (setf (gfw:default-widget dlg) btn-add) (gfw:show dlg t) dlg)))) From jdunrue at gmail.com Thu Sep 13 05:56:11 2007 From: jdunrue at gmail.com (Jack Unrue) Date: Wed, 12 Sep 2007 23:56:11 -0600 Subject: [graphic-forms-devel] Layout workings? In-Reply-To: <002101c7f2fa$a79e1750$6401a8c0@Aiden> References: <002101c7f2fa$a79e1750$6401a8c0@Aiden> Message-ID: On 9/9/07, Ken Perry wrote: > > First I realize this is in alpha so if the answer is the layout mangier is > not working fully that is fine. I just want to know how this is supposed to > work. You are right in two ways -- the whole thing needs much more functionality, and there are bugs. > If that is how it is supposed to work it is not. My list box is not the > same length as the edit box let alone the edit box and label together. > > Can you take a look at this and tell me what I should be doing to line > these controls up in this dialog? I got something closer to what I think you were intending. My revised version of your code is here: http://lispwidgets.net/fruit2.lisp Note that I used an in-package form at the top of the file, which you may want to remove. I changed the dialog's layout to be a border-layout. The top-panel containing the fruit label and the edit control are placed in the top region of the layout. The inner-panel containing the list-box is placed in the center region. The btn-panel is placed in the bottom region. These placements are accomplished using the setf function for gfw:layout-attribute. There is a bug in border-layout where spacing is not allocated to the center region, so I had to cheat by setting a top-margin value for the inner-layout. The list-box is sized by a combination of setting a minimum-size on the list-box and using a heap-layout for the inner-panel. I got the buttons to be equal widths by including the :normalize style for the btn-layout. This exercise revealed a second bug, which is that I had to also include the :horizontal style keyword explicitly, when in fact it should be the default anyway. I realize that you had wanted the buttons to fill the available space, but there is a limitation of the layout management system in that I don't currently provide a way to get multiple children to fill the available width (or height). The heap-layout sort of works that way, but it's designed for just one visible child at a time. Also, I don't currently provide a way to right-justify or bottom-justify child elements within a panel. There are several possible ways to provide these behaviors, but I haven't decided which way to go yet. But this is why the buttons are still aligned left in the btn-panel. By the way, you had the :default-button style set on two of the buttons. I changed it to just be the add button, but one or the other is fine. The general strategy for packing dialogs (and top-level windows) is to allow child panels and controls to be sized according to their preferred sizes, or set minimum or maximum sizes on them, and let the size of the container be determined by that. You don't want to explicitly set a size on the dialog for the scenario you are trying to achieve. Sorry for the long-winded reply, but there is one more comment I should make. I totally understand that part of the issue here is the difficulty in figuring how to use the layout managers. Obviously I understand them, having written the code, but for new folks it's not necessarily clear how it all fits together. This is something I will improve over time, with better examples and also better documentation. Not to mention bug fixes :-) -- Jack Unrue From jdunrue at gmail.com Thu Sep 13 05:59:17 2007 From: jdunrue at gmail.com (Jack Unrue) Date: Wed, 12 Sep 2007 23:59:17 -0600 Subject: [graphic-forms-devel] Problems with dialogs In-Reply-To: <003a01c7f3e5$dcb92510$6401a8c0@Aiden> References: <003a01c7f3e5$dcb92510$6401a8c0@Aiden> Message-ID: On 9/10/07, Ken Perry wrote: > > Since I was having trouble with the layouts looking right I > decided to try to make the program with out a layout mangier. > If you run this and maximize the dialog you will see that it all lies > up now. Now I am having a different problem though it seems > with out the layout mangier I lose the default buttons. I have > the btn-add set to be the default button but when I hit enter > on the edit box it gives me a warning and does nothing. Did I do > the default button correctly? The following is the running code: Other than the fact that you have the :default-button style set on two buttons (see my other email), I'm not sure what's happening. In my revised version of your other code with the layout managers, hitting enter results in no warning and no default action, either. I will investigate further. -- Jack Unrue From jyrki at jjkola.tk Sat Sep 15 15:12:26 2007 From: jyrki at jjkola.tk (Jyrki Jaakkola) Date: Sat, 15 Sep 2007 18:12:26 +0300 Subject: [graphic-forms-devel] Textedit demo crashing Message-ID: <46EBF65A.2010203@jjkola.tk> Hello! I have been testing textedit demo and I think may have found a bug. Whenever I enter at the most two characters to *textedit-control* the program halts with error EXCEPTION_ACCESS_VIOLATION. This doesn't happen if I enter at least three characters or if restart application (without restarting sbcl) after entering three characters. I'm running sbcl 1.0.6 on windows xp sp2. My development environment is slime 2.0 running on emacs 21.3. I'm using following libraries: cffi-070901, Closer to Mop 0.42 and lw-compat 0.22. Regards, Jyrki Jaakkola From kperry at blinksoft.com Sat Sep 15 16:36:40 2007 From: kperry at blinksoft.com (Ken Perry) Date: Sat, 15 Sep 2007 09:36:40 -0700 Subject: [graphic-forms-devel] Textedit demo crashing In-Reply-To: <46EBF65A.2010203@jjkola.tk> References: <46EBF65A.2010203@jjkola.tk> Message-ID: <002801c7f7b6$98821940$6401a8c0@Aiden> I have tested this with clisp-2.41 and if I understand he problem it doesn't happen under this lisp interpreter. Ken -----Original Message----- From: graphic-forms-devel-bounces at common-lisp.net [mailto:graphic-forms-devel-bounces at common-lisp.net] On Behalf Of Jyrki Jaakkola Sent: Saturday, September 15, 2007 8:12 AM To: graphic-forms-devel at common-lisp.net Subject: [graphic-forms-devel] Textedit demo crashing Hello! I have been testing textedit demo and I think may have found a bug. Whenever I enter at the most two characters to *textedit-control* the program halts with error EXCEPTION_ACCESS_VIOLATION. This doesn't happen if I enter at least three characters or if restart application (without restarting sbcl) after entering three characters. I'm running sbcl 1.0.6 on windows xp sp2. My development environment is slime 2.0 running on emacs 21.3. I'm using following libraries: cffi-070901, Closer to Mop 0.42 and lw-compat 0.22. Regards, Jyrki Jaakkola _______________________________________________ graphic-forms-devel mailing list graphic-forms-devel at common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/graphic-forms-devel From jdunrue at gmail.com Sat Sep 15 17:17:13 2007 From: jdunrue at gmail.com (Jack Unrue) Date: Sat, 15 Sep 2007 11:17:13 -0600 Subject: [graphic-forms-devel] Textedit demo crashing In-Reply-To: <46EBF65A.2010203@jjkola.tk> References: <46EBF65A.2010203@jjkola.tk> Message-ID: On 9/15/07, Jyrki Jaakkola wrote: > Hello! > > I have been testing textedit demo and I think may have found a bug. > Whenever I enter at the most two characters to *textedit-control* the > program halts with error EXCEPTION_ACCESS_VIOLATION. This doesn't > happen if I enter at least three characters or if restart application (without > restarting sbcl) after entering three characters. I'm not able to reproduce this, either by typing into the edit control, or by changing the code to add a couple characters when textedit initializes. I'm on SBCL; I see that Ken tried CLISP. Which character set are you using? Does the problem occur even with just plain ASCII characters? -- Jack Unrue From jyrki at jjkola.tk Sat Sep 15 20:10:53 2007 From: jyrki at jjkola.tk (Jyrki Jaakkola) Date: Sat, 15 Sep 2007 23:10:53 +0300 Subject: [graphic-forms-devel] Textedit demo crashing In-Reply-To: References: <46EBF65A.2010203@jjkola.tk> Message-ID: <46EC3C4D.40706@jjkola.tk> Jack Unrue wrote: > On 9/15/07, Jyrki Jaakkola wrote: >> I have been testing textedit demo and I think may have found a bug. >> Whenever I enter at the most two characters to *textedit-control* the >> program halts with error EXCEPTION_ACCESS_VIOLATION. This doesn't >> happen if I enter at least three characters or if restart application (without >> restarting sbcl) after entering three characters. > > I'm not able to reproduce this, either by typing into the edit control, > or by changing the code to add a couple characters when textedit > initializes. > > I'm on SBCL; I see that Ken tried CLISP. > > Which character set are you using? Does the problem occur even > with just plain ASCII characters? > Writing text in just plain ascii (not even extended ascii), as far as I know. Emacs says that charset is iso-latin-1. It's even enough to remove the space which is in the text box by default. Here is what I do before running the demo: -- gf-startup.lisp -- (load "d:/lispbox-0.7/.sbcl/systems/graphic-forms/config.lisp") (gfsys::configure-asdf) (asdf:operate 'asdf:load-op :graphic-forms-uitoolkit) (load "d:/lispbox-0.7/.sbcl/systems/graphic-forms/tests.lisp") (gfsys::load-tests) --------------------- I have only changed paths to right ones in config.lisp. I tried now to run the demo from sbcl without emacs and slime and it behaves in same way. I even tried running the demo so that I first removed compiled files for graphic-forms and required dependencies. Here is exact error message which I got when running sbcl without emacs: ------------------ * (gft:textedit) WARNING: # debugger invoked on a SIMPLE-ERROR: EXCEPTION_ACCESS_VIOLATION Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit debugger, returning to top level. ("bogus stack frame") 0] 0 ------------------ And here is back trace when running through slime: ------------------ EXCEPTION_ACCESS_VIOLATION [Condition of type SIMPLE-ERROR] Restarts: 0: [ABORT-REQUEST] Abort handling SLIME request. 1: [ABORT] Exit debugger, returning to top level. Backtrace: 0: ("bogus stack frame") 1: ("foreign function: #x7E3AEBCB") 2: ("foreign function: #x7E3AED69") 3: ("foreign function: #x7E3AF253") 4: ("foreign function: #x7E3A1004") 5: ("foreign function: #x7E389A6F") 6: ("foreign function: #x7E382FBB") 7: ("foreign function: #x7E38B408") 8: ("foreign function: #x7E368734") 9: ("foreign function: #x7E368816") 10: ("foreign function: #x7E36C63F") 11: ("foreign function: #x7E36F65D") 12: (GRAPHIC-FORMS.UITOOLKIT.SYSTEM::CALL-WINDOW-PROC #.(SB-SYS:INT-SAP #X7E38B3B4) #.(SB-SYS:INT-SAP #X00560F00) 256 46 22216705) 13: ((LAMBDA (SB-ALIEN::ARGS-POINTER SB-ALIEN::RESULT-POINTER FUNCTION)) 588983 588979 #) 14: ("foreign function: #x4115B5") 15: ("foreign function: #x4025D3") 16: ("foreign function: #x210077B") 17: ("foreign function: #x7E368734") 18: ("foreign function: #x7E368816") 19: ("foreign function: #x7E3689CD") 20: ("foreign function: #x7E3696C7") 21: (GRAPHIC-FORMS.UITOOLKIT.SYSTEM::DISPATCH-MESSAGE #.(SB-SYS:INT-SAP #X0113FFC8)) 22: (GRAPHIC-FORMS.UITOOLKIT.WIDGETS:DEFAULT-MESSAGE-FILTER 1 #.(SB-SYS:INT-SAP #X0113FFC8)) 23: (GRAPHIC-FORMS.UITOOLKIT.WIDGETS:MESSAGE-LOOP #) 24: (SB-INT:SIMPLE-EVAL-IN-LEXENV (GRAPHIC-FORMS.UITOOLKIT.TESTS:TEXTEDIT) #) 25: (SWANK::EVAL-REGION "(gft:textedit) " T) 26: ((LAMBDA NIL)) 27: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-SYNTAX-HOOKS (T)) # # #) 28: (SWANK::CALL-WITH-BUFFER-SYNTAX #) 29: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:LISTENER-EVAL "(gft:textedit) ") #) 30: ((LAMBDA NIL)) 31: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK (T T)) # # # #) 32: ((LAMBDA NIL)) 33: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK (T T)) # # # #) 34: (SWANK::CALL-WITH-REDIRECTED-IO # #) 35: (SWANK::CALL-WITH-CONNECTION # #) 36: (SWANK::HANDLE-REQUEST #) 37: (SWANK::SIMPLE-SERVE-REQUESTS #) 38: (SWANK::SERVE-CONNECTION # NIL NIL :ISO-LATIN-1-UNIX) 39: (SWANK::SETUP-SERVER 0 # NIL NIL :ISO-LATIN-1-UNIX) 40: (SWANK:START-SERVER "c:/DOCUME~1/JYRKIJ~1/LOCALS~1/Temp/slime.2572") 41: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:START-SERVER "c:/DOCUME~1/JYRKIJ~1/LOCALS~1/Temp/slime.2572" :EXTERNAL-FORMAT :ISO-LATIN-1-UNIX) #) 42: (INTERACTIVE-EVAL (SWANK:START-SERVER "c:/DOCUME~1/JYRKIJ~1/LOCALS~1/Temp/slime.2572" :EXTERNAL-FORMAT :ISO-LATIN-1-UNIX)) 43: (SB-IMPL::REPL-FUN NIL) 44: (SB-IMPL::REPL-FUN NIL) 45: ((LAMBDA NIL)) 46: ((LAMBDA NIL)) 47: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #) 48: (SB-IMPL::TOPLEVEL-REPL NIL) 49: (SB-IMPL::TOPLEVEL-INIT) 50: ((LABELS SB-IMPL::RESTART-LISP)) 51: ("foreign function: #x4115B5") 52: ("foreign function: #x40A56A") ------------------ I hope this helps. Regards, Jyrki Jaakkola