Re: A pair of questions regarding FVWM setup

2001-08-05 Thread Dominik Vogt
On Sat, Aug 04, 2001 at 11:35:27AM +, Mikhael Goikhman wrote:
> On 04 Aug 2001 16:15:37 +0700, Dmitry Yu. Bolkhovityanov wrote:
> > 
> > First, is it possible to do a Windows-3.1-like windows and menus?  The
> > problem with borders is that in case of "BorderStyle -- flat" handles are
> > invisible even without "HiddenHandles".  The accompanying problem with menus
> > is that there's only "BorderWidth" flag, without an ability to switch
> > 3D-ness off (with Nops too).  Both seems to be caused by lack of
> > "BorderColor" concept.  Am I missing something?
> 
> Windows have "BorderColor" concept. Style * [Hilight]BorderColorset.
> 
> Menus have "BorderColor" concept (kind of) using MenuStyle MenuColorset
> and ActiveColorset; you may specify sh and hi colors in these colorsets.
> 
> I don't remember how should look windows-3.1 windows and menus, so I can't
> say whether something is missing to fully or partially emulate the look.
> It is hard to believe someone is interesting in microsoft solutions. :)

It simply has 2D borders.  It looks a bit like a wire frame around
the windows.  You can get the same effect if you choose sh/hi
colours on the border appropriately, e.g.

  bg = black
  sh = white
  hi = white

> > Second, is it possible to create an "if-then-else" construct in a
> > function?  I tried to emulate the behaviour of Win9x's TaskBar, which can be
> > described as:
> > 
> > if (Iconic  ||  !Raised)
> > {
> > Iconify Off
> > Raise
> > Focus
> > }
> > else
> > {
> > Iconify On
> > }
> > 
> > (i.e. deiconify if iconified, otherwise raise of not raised, otherwise
> > iconify).
> 
> We discussed adding shell abilities to fvwmrc two years ago and the
> decission was not to do this, since preprocessors and PipeRead can do it.

How about this enhancement to conditional commands:

  Next (conditions) { false-action } true-action

This would allow an "else" case in all conditional commands
without the need to store a return code of these commands.  For
example:

  AddToFunc ToggleWindow
  + I Next ($0) { Exec $0 } Close

> > AddToFunc "Deiconify-Raise-Focus"
> > + "I" Iconify Off
> > + "I" Raise
> > + "I" Focus
> > AddToFunc "Deiconify-or-Raise-or-Iconify"
> > + "I" Current (Iconic) Deiconify-Raise-Focus
> > + "I" Current (!Raised) Raise
> > + "I" Current (Raised, !Iconic) Iconify On

  AddToFunc Deiconify-Raise-Focus
  + I Iconify Off
  + I Raise
  + I Focus
  AddToFunc "Deiconify-or-Raise-or-Iconify"
  + I Current (Raised, !Iconic) { Deiconify-Raise-Focus } Iconify on

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
--
Visit the official FVWM web page at http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: A pair of questions regarding FVWM setup

2001-08-04 Thread Dmitry Yu. Bolkhovityanov
On  4 Aug 01 at 11:35, [EMAIL PROTECTED] wrote:

> On 04 Aug 2001 16:15:37 +0700, Dmitry Yu. Bolkhovityanov wrote:
> >
> > First, is it possible to do a Windows-3.1-like windows and menus?  The
> > problem with borders is that in case of "BorderStyle -- flat" handles are
> > invisible even without "HiddenHandles".  The accompanying problem with menus
> > is that there's only "BorderWidth" flag, without an ability to switch
> > 3D-ness off (with Nops too).  Both seems to be caused by lack of
> > "BorderColor" concept.  Am I missing something?
>
> Windows have "BorderColor" concept. Style * [Hilight]BorderColorset.
>
> Menus have "BorderColor" concept (kind of) using MenuStyle MenuColorset
> and ActiveColorset; you may specify sh and hi colors in these colorsets.
>
> I don't remember how should look windows-3.1 windows and menus, so I can't
> say whether something is missing to fully or partially emulate the look.
> It is hard to believe someone is interesting in microsoft solutions. :)

Thanks, I'll try it.

In fact, it isn't mocrosoft solutions, but just a "simple",
"lightweight", etc. interface -- the same basic concepts (i.e. no 3D, but
black borders around objects) were used in many Dos apps, and are still used
on handhelds like Palm and cellular phones.  I used Win31 just as a most
well-known example. ;-)

> > Second, is it possible to create an "if-then-else" construct in a
> > function?  I tried to emulate the behaviour of Win9x's TaskBar, which can be
> > described as:
> >
> > if (Iconic  ||  !Raised)
> > {
> > Iconify Off
> > Raise
> > Focus
> > }
> > else
> > {
> > Iconify On
> > }
> >
> > (i.e. deiconify if iconified, otherwise raise of not raised, otherwise
> > iconify).
>
> We discussed adding shell abilities to fvwmrc two years ago and the
> decission was not to do this, since preprocessors and PipeRead can do it.
>
> But if-else construct does not seem too hard to implement. If we do this
> we may have if, else, endif commands, so braces are not needed.
>
> if (Iconic || !Raised)
> Iconify Off
> else
> if (!Iconic)
> Iconify On
> endif
> endif
>
> This only seems complex, in fact it is simple. There is a list of boolean
> conditions (one for each level of "if") and the current command is
> executed or skipped depending on the last boolean. (if, else, endif)
> commands only manipulate this list of booleans (push, not, pop).

Well, it isn't complex at all -- elsif is just a shortcut for "else if"
in most modern languages.

As to using SetEnv+PipeRead -- yes, it's a neat hack ;-)

   ___
   Dmitry Yu. Bolkhovityanov  |  Novosibirsk, RUSSIA
   phone (383-2)-39-49-56 |  The Budker Institute of Nuclear Physics
  |  Lab. 5-13
--
Visit the official FVWM web page at http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: A pair of questions regarding FVWM setup

2001-08-04 Thread Mikhael Goikhman
On 04 Aug 2001 16:15:37 +0700, Dmitry Yu. Bolkhovityanov wrote:
> 
> First, is it possible to do a Windows-3.1-like windows and menus?  The
> problem with borders is that in case of "BorderStyle -- flat" handles are
> invisible even without "HiddenHandles".  The accompanying problem with menus
> is that there's only "BorderWidth" flag, without an ability to switch
> 3D-ness off (with Nops too).  Both seems to be caused by lack of
> "BorderColor" concept.  Am I missing something?

Windows have "BorderColor" concept. Style * [Hilight]BorderColorset.

Menus have "BorderColor" concept (kind of) using MenuStyle MenuColorset
and ActiveColorset; you may specify sh and hi colors in these colorsets.

I don't remember how should look windows-3.1 windows and menus, so I can't
say whether something is missing to fully or partially emulate the look.
It is hard to believe someone is interesting in microsoft solutions. :)

> Second, is it possible to create an "if-then-else" construct in a
> function?  I tried to emulate the behaviour of Win9x's TaskBar, which can be
> described as:
> 
> if (Iconic  ||  !Raised)
> {
> Iconify Off
> Raise
> Focus
> }
> else
> {
> Iconify On
> }
> 
> (i.e. deiconify if iconified, otherwise raise of not raised, otherwise
> iconify).

We discussed adding shell abilities to fvwmrc two years ago and the
decission was not to do this, since preprocessors and PipeRead can do it.

But if-else construct does not seem too hard to implement. If we do this
we may have if, else, endif commands, so braces are not needed.

if (Iconic || !Raised)
Iconify Off
else
if (!Iconic)
Iconify On
endif
endif

This only seems complex, in fact it is simple. There is a list of boolean
conditions (one for each level of "if") and the current command is
executed or skipped depending on the last boolean. (if, else, endif)
commands only manipulate this list of booleans (push, not, pop).

> But this can't be done with a syntax of "if-then; if-then", since the
> following happens:
> 
> AddToFunc "Deiconify-Raise-Focus"
> + "I" Iconify Off
> + "I" Raise
> + "I" Focus
> AddToFunc "Deiconify-or-Raise-or-Iconify"
> + "I" Current (Iconic) Deiconify-Raise-Focus
> + "I" Current (!Raised) Raise
> + "I" Current (Raised, !Iconic) Iconify On
> 
> but by the time the last line is reached, the window will *always* be raised
> and deiconified.  Is this fixable somehow?

Well, with some hacks everything is possible, including your example. :)

  SetEnv MyCondition 0
  Current (Iconic || !Raised) SetEnv MyCondition 1
  PipeRead `if [ $[MyCondition] == 1]; echo Iconify Off; echo Raise; \
echo Focus; else echo Iconify On; fi`

Regards,
Mikhael.
--
Visit the official FVWM web page at http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


A pair of questions regarding FVWM setup

2001-08-04 Thread Dmitry Yu. Bolkhovityanov
Hi!

First, is it possible to do a Windows-3.1-like windows and menus?  The
problem with borders is that in case of "BorderStyle -- flat" handles are
invisible even without "HiddenHandles".  The accompanying problem with menus
is that there's only "BorderWidth" flag, without an ability to switch
3D-ness off (with Nops too).  Both seems to be caused by lack of
"BorderColor" concept.  Am I missing something?

Second, is it possible to create an "if-then-else" construct in a
function?  I tried to emulate the behaviour of Win9x's TaskBar, which can be
described as:

if (Iconic  ||  !Raised)
{
Iconify Off
Raise
Focus
}
else
{
Iconify On
}

(i.e. deiconify if iconified, otherwise raise of not raised, otherwise
iconify).

But this can't be done with a syntax of "if-then; if-then", since the
following happens:

AddToFunc "Deiconify-Raise-Focus"
+ "I" Iconify Off
+ "I" Raise
+ "I" Focus
AddToFunc "Deiconify-or-Raise-or-Iconify"
+ "I" Current (Iconic) Deiconify-Raise-Focus
+ "I" Current (!Raised) Raise
+ "I" Current (Raised, !Iconic) Iconify On

but by the time the last line is reached, the window will *always* be raised
and deiconified.  Is this fixable somehow?

TIA,
Dmitry

   ___
   Dmitry Yu. Bolkhovityanov  |  Novosibirsk, RUSSIA
   phone (383-2)-39-49-56 |  The Budker Institute of Nuclear Physics
  |  Lab. 5-13
--
Visit the official FVWM web page at http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]