Project

General

Profile

Actions

Support #4841

open

Please help I'm badly stuck!

Added by Matt Picas about 8 years ago.

Status:
New
Priority:
High
Assignee:
-
Target version:
-
Start date:
04/02/2016
Due date:
% Done:

0%

Estimated time:

Description

Hi can anyone help me create a new page? I am running everything out of a container called *parent and have images that I want to link to a new page. I've been at it all day but I haven't be able to figure out how to get everything to load into a separate page. Basically I just want to get a new page with new images without displaying anything from the previous container as simple as possible (under a separate base path). Does anyone know the best way for me to do that?

Been trying for about 12 hours straight, I tried to achieve what I'm after by creating a stacked widget in the *parent container and then making a menu (which seems right since if it worked it would load only 1 instance at a time) but I'm not sure how to load a container (which I guess would have to be from another file to work). I tried with the following lines of code:

DragExample::DragExample(WContainerWidget *parent):

WContainerWidget(parent)

{

// That which enables single instances of the application and the switching between them

WStackedWidget *contents = new WStackedWidget();

// That which would hold clickable text if I allowed it and that will create the deploy paths to hold the instances of the application

WMenu *menu = new WMenu(contents, Vertical, this);

// Internal Base Path Enabled to / in the url

menu->setInternalPathEnabled();

menu->setInternalBasePath("/");

// Loads the file that contains the container hopefully **TEMPORARILY BROKEN AS UNDER MAINTENANCE)

// menu->addItem("Home", new mainpage());

// Not sure what the exact purpose is, but it provides a link between contents and the parent container of the project

this->addWidget(contents);

I tried to create something for it to read off of but I am a bit lost on how, I made a separate file called mainpage.cpp and put this in there:

#ifndef MAINPAGE_H_

#define MAINPAGE_H_

/// Class demonstrating drag and drop in Wt

class mainpage: public Wt::WContainerWidget

{

public:

mainpage(Wt::WContainerWidget *mainpage);

};

#endif

mainpage::mainpage(WContainerWidget *mainpage):

WContainerWidget(mainpage)

{

Wt::WImage *image = new Wt::WImage(Wt::WLink("logos/MyTestPic.jpg"),

this);

image->setMargin(5, Wt::Left);

}

I'm probably way off the mark so if anyone can please help me it means everything to me! I am lost

No data to display

Actions

Also available in: Atom PDF