Instruction to do the show/hide stuff in w32, qnx, beos,...


Subject: Instruction to do the show/hide stuff in w32, qnx, beos,...
From: Joaquin Cuenca (e98cuenc@yahoo.com)
Date: Wed Jul 26 2000 - 23:14:15 CDT


INSTRUCTIONS TO IMPLEMENT SHOW/HIDE TOOLBARS/STATUS
BAR FUNCTIONALITY
IN WIN32,QNX & BEOS

You have to implement the function:

void AP_XXXFrame::toggleBar(UT_uint32 iBarNb, UT_Bool
bBarOn)
iBarNb is the toolbar number, 0->Standard, 1->Format,
2->Extra,
bBarOn is the next status, UT_TRUE->show,
UT_FALSE->hide.

(For the status bar, the function is called
AP_UnixFrame::toggleStatusBar.)

You can copy&paste the AP_UnixFrame::toggleBar code
and it has to work
(really this function is ap specific and xp, but we
don't have an
AP_Frame class).

Next, you have to implement the EV_XXXToolbar::show &
EV_XXXToolbar::hide methods that are used in
the toggleBar function. The EV_XXXToolbar::show
method, makes visible
the toolbar associated with the EV_XXXToolbar, and the
EV_XXXToolbar::hide method make invisible the toolbar
associated with
the EV_XXXToolbar. For instance, in the unix version:

void EV_UnixToolbar::show(void)
{
        if (m_wToolbar)
                gtk_widget_show (m_wToolbar->parent);
}

void EV_UnixToolbar::hide(void)
{
        if (m_wToolbar)
                gtk_widget_hide (m_wToolbar->parent);
}

And in the GNOME version:

void EV_UnixGnomeToolbar::show(void)
{
        UT_uint32 nbToolbars = m_vecToolbars.getItemCount();
        for (UT_uint32 i = 0; i < nbToolbars; i++)
        {
                GtkWidget *toolbar = static_cast<GtkWidget *>
(m_vecToolbars.getNthItem(i));
                gtk_widget_show (toolbar->parent);
        }
}

void EV_UnixGnomeToolbar::hide(void)
{
        UT_uint32 nbToolbars = m_vecToolbars.getItemCount();
        for (UT_uint32 i = 0; i < nbToolbars; i++)
        {
                GtkWidget *toolbar = static_cast<GtkWidget *>
(m_vecToolbars.getNthItem(i));
                gtk_widget_hide (toolbar->parent);
                gtk_widget_queue_resize (toolbar->parent->parent);
        }
}

(and for the status bar is the same thing, but the
class is
AP_UnixStatusBar)

These are really the functions that do all the work.
Maybe you will need to refresh the size of the frame
after calling the
hide function (that depends of windows). If so, you
will have to
implement a function that says to windows that it have
to update the
size of the frame (you will have to implement it in
XAP_W32Frame::queue_resize). For instance, with gtk+,
I have to
refresh the main frame when the user hides the status
bar, so I have:

void AP_UnixStatusBar::hide(void)
{
        gtk_widget_hide (m_wStatusBar);
        m_pFrame->queue_resize();
}

And that's all! (I think...)

Please, if you have some problem with the
implementation of the
show/hide toolbars/status bar (or with the "english"
of this email),
ask me and I will try to be clearer.

P.S.: Sorry, I know that I've said that I will commit
the stubs for
windows/qnx/BeOS, but really, now I have to go to bed
(it's 6:15AM).
Good night guys!

=====
Joaquin Cuenca Abela
e-mail: e98cuenc@yahoo.com

__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/



This archive was generated by hypermail 2b25 : Wed Jul 26 2000 - 23:14:17 CDT