Counterpart to wpQueryConfirmations? - OS2
This is a discussion on Counterpart to wpQueryConfirmations? - OS2 ; Hi,
*IS* there a counterpart to the WPS call wpQueryConfirmations? No there
is not a wpSetConfirmations!! My WPS API book seems to be silent as the
documentation in the toolkit. It seems really odd that these can only
be set ...
-
Counterpart to wpQueryConfirmations?
Hi,
*IS* there a counterpart to the WPS call wpQueryConfirmations? No there
is not a wpSetConfirmations!! My WPS API book seems to be silent as the
documentation in the toolkit. It seems really odd that these can only
be set from the settings notebook (er, ok, how does the notebook manage
to set them??)
Enquiring minds want to know...
Thanks,
jeff
write me at: jgaynor at jqhome dot net
-
Re: Counterpart to wpQueryConfirmations?
On 10 Feb 2005 11:26:24 -0800, spam@jqhome.net wrote:
> *IS* there a counterpart to the WPS call wpQueryConfirmations?
It seems not.
> No there
> is not a wpSetConfirmations!! My WPS API book seems to be silent as the
> documentation in the toolkit. It seems really odd that these can only
> be set from the settings notebook (er, ok, how does the notebook manage
> to set them??)
Presumably it just stores the setting directly to wherever (I guess it's
an INI file setting, and I can't be bothered to check just now) without
defining and calling a method to do it (which would have allowed you to
hook in an override in a subclass).
Unfortunately significant parts of the WPS appear to have been
designed/implemented by people who didn't really fully understand what
they were doing and why.
The above is really weird, because the confirmations stuff seems to be
system global and they've used an instance method. I'd have expected it
to be a class method.
So in short, it's a complete mess.
-
Re: Counterpart to wpQueryConfirmations?
Thanks Paul!
OK, then does anyone know where these values are stored? I snooped
through the ini files and found nothing.
Also, docs and my manual say that these can be changed through the
settings notebook. I didn't see anyplace to set these. ??! Is it
possible these are class values and there is just an instance method
for no good reason? This is getting stranger the more I look at it...
There aren't even setup string values corresponding to these.
-- jeff
-
Re: Counterpart to wpQueryConfirmations?
On Fri, 11 Feb 2005 16:35:23 UTC, spam@jqhome.net wrote:
>
> OK, then does anyone know where these values are stored? I snooped
> through the ini files and found nothing.
>
> Also, docs and my manual say that these can be changed through the
> settings notebook. I didn't see anyplace to set these. ??! Is it
> possible these are class values and there is just an instance method
> for no good reason? This is getting stranger the more I look at it...
> There aren't even setup string values corresponding to these.
The data is stored in os2.ini under PM_ControlPanel (e.g. ConfirmDelete).
The onlu place these items can be set is in System->Confirmations
(or WorkplaceShell->Confirmations if you have XWP/eWP).
As to why wpQueryConfirmations is an instance method of WPPbject,
I can only speculate. It may simply be a matter of convenience:
the method can be invoked on the object about to be deleted without
the need to locate some specialized object or class first. The
fact that the settings can only be changed in one location makes
some sense. It's unlikely you'd set confirmations for specific
objects (i.e. "warn me before I delete this particular file"),
and probably undesirable to have a global setting available from
every object.
--
== == almost usable email address: rich AT e-vertise.com == ==
__________________________________________________ _________________
|
| New - Remote Workplace Server v0.60
Rich Walsh | interact with the WPS from any program
Ft Myers, FL | http://e-vertise.com/rws/rws060.zip
__________________________________________________ _________________
-
Re: Counterpart to wpQueryConfirmations?
On Fri, 11 Feb 2005 16:35:23 UTC, spam@jqhome.net wrote:
> Thanks Paul!
>
> OK, then does anyone know where these values are stored? I snooped
> through the ini files and found nothing.
>
> Also, docs and my manual say that these can be changed through the
> settings notebook. I didn't see anyplace to set these. ??! Is it
> possible these are class values and there is just an instance method
> for no good reason? This is getting stranger the more I look at it...
> There aren't even setup string values corresponding to these.
Not true. see below.
Open the settings
look on the page named symbol. (Folders have a subpage to assign
another symbol to an open folder)
The location of the file differs:
on a program(file)object:
- it can be bound to the .exe itself like any other resource
- it can be in the same directoroy as the .exe having the same name -
but .ico as extension
on any object:
- it can be in the EAs
- it can be in the ini file.
- it can be that of the program associated as the (default) one that
should ber started.
excerpt of WorplaceShjell programming Guide 4.52
A program or Workplace Shell object would call the following methods
to get information about an object's icons. A Workplace Shell object
would override these methods to define its icons.
Method Name Description
wpQueryHandleFromContents Returns a handle to a known
system data type based on a
file's contents. This is an
abstract method; subclasses
that describe files for which
a system handle type exist
(such as WPIcon or WPBitmap)
should subclass this method.
wpQueryIconData Returns the information that
defines the object's icon.
This overrides the class
default icon defined by
wpclsQueryIconData.
wpclsQueryIconData Returns the information that
defines the class default
icon. This icon is associated
with every object of this
class. This icon can be
changed for an individual
object if:
o The object overrides
wpQueryIconData.
o The wpSetIconData method
is called.
o The wpSetup method is called
with the ICONFILE or
ICONRESOURCE keyword, or if
the user edits the icon on
the General page of the
Settings notebook.
For a folder class, this is
the closed folder icon.
wpclsQueryIconDataN Returns the information that
defines the nth class default
animation icon.
Note:
This method is available only
for a folder class. It
defines the default open
folder icon for all objects
of this class. This icon can
be changed for an individual
object if wpSetup is called
with the ICONNFILE or
ICONNRESOURCE keyword, or if
the user edits the animation
icon on General page 2 of the
Settings notebook.
·΅
A program or Workplace Shell object would call the following methods
to get information about an object's icons. These methods are not
normally overridden by the object.
Method Name Description
wpQueryIcon Returns the handle of the
object's icon.
wpclsQueryIcon Returns the handle of the
class default icon. For a
folder class, this method
returns the handle of the
class' default closed folder
icon.
wpclsQueryIconN Returns the handle of the nth
class default animation icon.
This method is available only
for a folder class. It returns
the handle of the class'
default open folder icon.
·΅
A program or Workplace Shell object would call the following methods
to change the icon for an object. These methods are not normally
overridden by the object.
Method Name Description
wpSetIcon Sets the handle of the
object's icon. This handle is
not saved in the persistent
data of the object, so it has
effect until the object goes
dormant. This method affects
all open views of the object.
For a folder object, wpSetIcon
affects the icon displayed:
o In the title bar.
o On the Toolbar.
o On the General page 1 of
the Settings notebook.
o In all containers if the
object is closed.
If the object is open, all
containers continue to show
the object's animation
icon.
wpSetIconData Sets the definition for the
object's icon. This icon
definition is saved with the
persistent data of the object.
It permanently changes the
object's icon. This method
automatically calls wpSetIcon
to update the visual display
of the object's icon.
wpSetProgIcon Sets the visible icon
associated with the program
reference or program file
object. This method is
available only for a program
reference or program file
object.
wpclsSetIcon Sets the handle of the default
class icon.
wpclsSetIconData Sets the definition of the
default class icon.
·΅
excerpt of WorkPlaceShell Programming Guide
The following sample code fragment shows how to obtain the icon
associated with the TUTORIAL.EXE file and shows how to display it as
the user's tutorial application:
#define INCL_WINWORKPLACE
#include "os2.h"
PSZ pszFileName = "tutorial.exe";
PSZ pszMyTutorial = "mytutor.exe";
HPOINTER hptr;
ULONG rc;
{
hptr = WinLoadFileIcon(pszFileName, FALSE);
if (hptr != NULL)
{
/* Obtain the icon associated with TUTORIAL.EXE for displaying
purpose only */
rc = WinSetFileIcon(pszMyTutorial, hptr);
if (rc != NULL)
{
/* MYTUTOR.EXE now has the icon associated with TUTORIAL.EXE */
}
else
{
/* WinSetFileIcon failed */
}
}
else
{
/* WinLoadFileIcon failed */
}
-
Re: Counterpart to wpQueryConfirmations?
It's meant to work this way:
override wpQueryConfirmations by calling the parent first, and then
manipulate the return of the parent method.
The idea is this: the WPS calls your object to find out how the
confirmations for your object are supposed to be like (when your object
wants that an action is confirmed or not). It might only do this once (per
uptime of your system).
They are then employed the way your object specified them on all calls that
need to be
confirmed (delete,rename, copy,move,create etc.), that is, it will then call
the confirm method
(for example: wpConfirmDelete) if a confirmation was specified in the return
value from wpQueryConfirmations, otherwise it will not.
(Basics: OS/2 Workplace Shell API by Mindy Pollack).
Lars
schrieb im Newsbeitrag
news:1108063584.847282.281270@g14g2000cwa.googlegr oups.com...
> Hi,
>
> *IS* there a counterpart to the WPS call wpQueryConfirmations? No there
> is not a wpSetConfirmations!! My WPS API book seems to be silent as the
> documentation in the toolkit. It seems really odd that these can only
> be set from the settings notebook (er, ok, how does the notebook manage
> to set them??)
>
> Enquiring minds want to know...
>
> Thanks,
>
> jeff
>
> write me at: jgaynor at jqhome dot net
>
-
Re: Counterpart to wpQueryConfirmations?
Hi,
in order to answer the questions that Paul has sent:
1.) "wpclsSetSetting" for the WPSystem object sets the values that wpQueryConfirmations will return.
If you look at the "confirmations" settings page, you will find them all.
For wpclsSetSetting, look up "WPSystem" class and "wpclsSetSetting" in the WPS reference.
2.) "OS/2 Workplace Shell API" is a book written by Mindy Pollack (publisher Whiley, 1995,
ISBN:0-471-03872-5). Of course, it's out of print, but I bought a used copy. It's a bit outdated
(for Warp3 and peculiarities for OS/2 2.1) but it explains a lot about the obscure and unknown stuff
of WPS programming.
Lars
Lars Erdmann schrieb:
> It's meant to work this way:
>
> override wpQueryConfirmations by calling the parent first, and then
> manipulate the return of the parent method.
> The idea is this: the WPS calls your object to find out how the
> confirmations for your object are supposed to be like (when your object
> wants that an action is confirmed or not). It might only do this once (per
> uptime of your system).
> They are then employed the way your object specified them on all calls that
> need to be
> confirmed (delete,rename, copy,move,create etc.), that is, it will then call
> the confirm method
> (for example: wpConfirmDelete) if a confirmation was specified in the return
> value from wpQueryConfirmations, otherwise it will not.
>
> (Basics: OS/2 Workplace Shell API by Mindy Pollack).
>
> Lars
>
> schrieb im Newsbeitrag
> news:1108063584.847282.281270@g14g2000cwa.googlegr oups.com...
>
>>Hi,
>>
>>*IS* there a counterpart to the WPS call wpQueryConfirmations? No there
>>is not a wpSetConfirmations!! My WPS API book seems to be silent as the
>>documentation in the toolkit. It seems really odd that these can only
>>be set from the settings notebook (er, ok, how does the notebook manage
>>to set them??)
>>
>>Enquiring minds want to know...
>>
>>Thanks,
>>
>>jeff
>>
>>write me at: jgaynor at jqhome dot net
>>
>
>
>
-
Re: Counterpart to wpQueryConfirmations?
On Sun, 13 Feb 2005 23:05:00 +0100, Lars Erdmann
wrote:
> in order to answer the questions that Paul has sent:
>
> 1.) "wpclsSetSetting" for the WPSystem object sets the values that wpQueryConfirmations will return.
> If you look at the "confirmations" settings page, you will find them all.
> For wpclsSetSetting, look up "WPSystem" class and "wpclsSetSetting" in the WPS reference.
Ah heck, I'd forgotten all about this. I went into all that when I wrote
my Sysset class (http://home.clara.net/orac/os2.htm#sysset).
wpclsSetSetting and wpclsQuerySetting is something else that most class
implementers just never understood, which is a real shame as it could be
so powerful.