Project

General

Profile

Actions

Bug #254

closed

LazyLoading menu items do not behave properly in vertical layouts

Added by Koen Deforche over 14 years ago. Updated about 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
12/30/2009
Due date:
% Done:

0%

Estimated time:

Description

#include <stdio.h>

#include <iostream>
#include <boost/lexical_cast.hpp>

#include <Wt/WApplication>
#include <Wt/WContainerWidget>
#include <Wt/WStackedWidget>
#include <Wt/WMenu>
#include <Wt/WTextEdit>
#include <Wt/WVBoxLayout>
#include <Wt/WPushButton>

using namespace Wt;

class TestApplication : public WApplication {
public:
 TestApplication(const WEnvironment& env) : WApplication(env)
  {
    WVBoxLayout *vertLayout = new WVBoxLayout(root());
    vertLayout->setSpacing(0);
    vertLayout->setContentsMargins(0,0,0,0);

    WStackedWidget *contentsStack = new WStackedWidget();
    // Show scrollbars when needed ...
    contentsStack->setOverflow(WContainerWidget::OverflowAuto);
    // ... and work around a bug in IE (see setOverflow() documentation)
    contentsStack->setPositionScheme(Relative);
    contentsStack->setStyleClass("contents");

    WMenu *menu_ = new WMenu(contentsStack, Horizontal, 0);
    menu_->setRenderAsList(true);
    menu_->setStyleClass("menu mainmenu");

    WContainerWidget *userWidget = new WContainerWidget();
    userWidget->setObjectName("UserManager");
    menu_->addItem("User", userWidget, WMenuItem::PreLoading); // <- fails if not PreLoading

    menu_->select(0);

    menu_->setInternalPathEnabled("/");

    //setInternalPath(pathName_, true);
    vertLayout->addWidget(menu_, 0);
    vertLayout->addWidget(contentsStack, 1);
  }

private:
};

WApplication *createApplication(const WEnvironment& env)
{
  WApplication *app = new TestApplication(env);
  return app;
}

int main(int argc, char **argv)
{
  return WRun(argc, argv, &createApplication);
}
Actions #1

Updated by Pieter Libin about 14 years ago

  • Status changed from InProgress to Resolved
Actions #2

Updated by Koen Deforche about 14 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF