comp.lang.ada
 help / color / mirror / Atom feed
* How to implement JEWL File dialogs?
@ 2010-10-26  8:25 tolkamp
  2010-10-26  8:41 ` Yannick Duchêne (Hibou57)
  2010-10-26  9:22 ` Yannick Duchêne (Hibou57)
  0 siblings, 2 replies; 4+ messages in thread
From: tolkamp @ 2010-10-26  8:25 UTC (permalink / raw)


I try to implement an file selection window using Open_Dialog. Here is
the code:

My_File_Selection_Dialog : Open_Dialog_Type;
--
--
My_File_Selection_Dialog := Open_Dialog("file name");
end;

Nothing is displayed when this code is running. I expect an input file
selection window as described in section 6.3 of
JEWL.windows User Manual
http://www.cmis.brighton.ac.uk/staff/je/jewl/docs/windows.htm#common-ops



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to implement JEWL File dialogs?
  2010-10-26  8:25 How to implement JEWL File dialogs? tolkamp
@ 2010-10-26  8:41 ` Yannick Duchêne (Hibou57)
  2010-10-26  9:22 ` Yannick Duchêne (Hibou57)
  1 sibling, 0 replies; 4+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-10-26  8:41 UTC (permalink / raw)


Le Tue, 26 Oct 2010 10:25:44 +0200, tolkamp <f.tolkamp@gmail.com> a écrit:

> I try to implement an file selection window using Open_Dialog. Here is
> the code:
>
> My_File_Selection_Dialog : Open_Dialog_Type;
> --
> --
> My_File_Selection_Dialog := Open_Dialog("file name");
> end;
>
> Nothing is displayed when this code is running.
I do not know JEWEL (just discovered it, thanks to you), but I may try to  
guess : do you create a main window prior to your attempt to open a file  
dialog ? File dialogs may send message which have to be handle, and this  
can be done only if a window procedure can receive this (at least at level  
of the Windows API, as I guess this is probably not exposed by JEWEL).

May be a longer excerpt would be welcome here, as we probably need more  
context.

-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to implement JEWL File dialogs?
  2010-10-26  8:25 How to implement JEWL File dialogs? tolkamp
  2010-10-26  8:41 ` Yannick Duchêne (Hibou57)
@ 2010-10-26  9:22 ` Yannick Duchêne (Hibou57)
  2010-10-28 11:10   ` tolkamp
  1 sibling, 1 reply; 4+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-10-26  9:22 UTC (permalink / raw)


Le Tue, 26 Oct 2010 10:25:44 +0200, tolkamp <f.tolkamp@gmail.com> a écrit:

> I try to implement an file selection window using Open_Dialog. Here is
> the code:
>
> My_File_Selection_Dialog : Open_Dialog_Type;
> --
> --
> My_File_Selection_Dialog := Open_Dialog("file name");
> end;
>
> Nothing is displayed when this code is running. I expect an input file
> selection window as described in section 6.3 of
> JEWL.windows User Manual

OK, I see. The spec in not clear enough I feel, I had to look at the  
implementation to understand what is wrong.

Here is : Open_Dialog does not open anything, this is just a kind of  
constructor (bad name for a constructor). Think of it as if it was named  
Initialize_Open_Dialog. The spec just says “-- create an open file dialog  
with this title.”, but this ambiguous with such a name.

Open_Dialog returns an instance of a File_Dialog_Type.
File_Dialog_Type is derived from Common_Dialog_Type.
Common_Dialog_Type has a method named Execute : function Execute (Dialog :  
Common_Dialog_Type) return Boolean;
There as well, the spec is lacking expressiveness, as it just say :

    --  Execute (Dialog)      -- execute the dialog and return True if the  
OK
    --                        -- button was used to close the dialog and  
False
    --                        -- otherwise.

Actually, I can tell you that this is this Execute method which display  
the dialog (the spec does not say this, but it is what the implementation  
actually do).

So, you just have to invok Execute on the instance you created with  
Open_Dialog.

Tell if that works :)

-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to implement JEWL File dialogs?
  2010-10-26  9:22 ` Yannick Duchêne (Hibou57)
@ 2010-10-28 11:10   ` tolkamp
  0 siblings, 0 replies; 4+ messages in thread
From: tolkamp @ 2010-10-28 11:10 UTC (permalink / raw)


On 26 okt, 11:22, Yannick Duchêne (Hibou57) <yannick_duch...@yahoo.fr>
wrote:
> Le Tue, 26 Oct 2010 10:25:44 +0200, tolkamp <f.tolk...@gmail.com> a écrit:
>
> > I try to implement an file selection window using Open_Dialog. Here is
> > the code:
>
> > My_File_Selection_Dialog : Open_Dialog_Type;
> > --
> > --
> > My_File_Selection_Dialog := Open_Dialog("file name");
> > end;
>
> > Nothing is displayed when this code is running. I expect an input file
> > selection window as described in section 6.3 of
> > JEWL.windows User Manual
>
> OK, I see. The spec in not clear enough I feel, I had to look at the  
> implementation to understand what is wrong.
>
> Here is : Open_Dialog does not open anything, this is just a kind of  
> constructor (bad name for a constructor). Think of it as if it was named  
> Initialize_Open_Dialog. The spec just says “-- create an open file dialog  
> with this title.”, but this ambiguous with such a name.
>
> Open_Dialog returns an instance of a File_Dialog_Type.
> File_Dialog_Type is derived from Common_Dialog_Type.
> Common_Dialog_Type has a method named Execute : function Execute (Dialog :  
> Common_Dialog_Type) return Boolean;
> There as well, the spec is lacking expressiveness, as it just say :
>
>     --  Execute (Dialog)      -- execute the dialog and return True if the  
> OK
>     --                        -- button was used to close the dialog and  
> False
>     --                        -- otherwise.
>
> Actually, I can tell you that this is this Execute method which display  
> the dialog (the spec does not say this, but it is what the implementation  
> actually do).
>
> So, you just have to invok Execute on the instance you created with  
> Open_Dialog.
>
> Tell if that works :)
>
> --
> Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
> les chiens.

Indeed when I add the function Execute(My_File_Selection_Dialog) the
expected File Dialog window is shown.
Now I can select the desired file and press button Open.
By adding the function Get_Name(My_File_Selection_Dialog) the selected
file can be used in the application.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-28 11:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-26  8:25 How to implement JEWL File dialogs? tolkamp
2010-10-26  8:41 ` Yannick Duchêne (Hibou57)
2010-10-26  9:22 ` Yannick Duchêne (Hibou57)
2010-10-28 11:10   ` tolkamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox