Skip to content

Commit c88b752

Browse files
author
Koen Deforche
committed
see Changelog
1 parent 828a866 commit c88b752

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1102
-574
lines changed

Changelog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
15-09-2008:
2+
* WWidget: move WFormWidget::setEnabled() to WWidget::setDisabled(),
3+
allowing all widgets to be set enabled or disabled.
4+
5+
* WWidget: isVisible() and isEnabled() reflect the computed visibility
6+
respectively being enabled taking int account ancestors settings
7+
8+
* WWidget: added setHiddenKeepsGeometry(), which uses css visibility
9+
for setHidden()
10+
111
03-09-2008:
212
* WDialog, Ext::Dialog, and related: allow for multiple modal dialogs
313
and nested exec() calls.

examples/widgetgallery/StyleLayout.C

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323

2424
#include "EmwebLoadingIndicator.h"
2525

26+
#ifdef WIN32
27+
#include <windows.h> // for Sleep()
28+
#else
29+
#include <unistd.h>
30+
#endif
2631
using namespace Wt;
2732

2833
StyleLayout::StyleLayout(EventDisplayer *ed)
@@ -83,6 +88,14 @@ void StyleLayout::loadingIndicatorSelected(WString indicator)
8388
}
8489
}
8590

91+
void StyleLayout::load(Wt::WMouseEvent) {
92+
#ifdef WIN32
93+
Sleep(2000);
94+
#else
95+
sleep(2);
96+
#endif
97+
}
98+
8699
WWidget *StyleLayout::wBoxLayout()
87100
{
88101
WContainerWidget *result = new WContainerWidget();

examples/widgetgallery/StyleLayout.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include <Wt/WString>
1414
#include <Wt/WEvent>
1515

16-
#include <unistd.h>
17-
1816
class StyleLayout : public ControlsWidget
1917
{
2018
public:
@@ -26,9 +24,7 @@ class StyleLayout : public ControlsWidget
2624
WWidget *css();
2725
WWidget *wLoadingIndicator();
2826
void loadingIndicatorSelected(Wt::WString indicator);
29-
void load(Wt::WMouseEvent) {
30-
sleep(2);
31-
}
27+
void load(Wt::WMouseEvent);
3228
WWidget *wBoxLayout();
3329
WWidget *wGridLayout();
3430
WWidget *wBorderLayout();

src/Wt/Http/Request

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ private:
7171
bool isStolen;
7272

7373
~Impl();
74+
void cleanup();
7475
};
7576

7677
boost::shared_ptr<Impl> fileInfo_;

src/Wt/Http/Request.C

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ UploadedFile::UploadedFile(const std::string& spoolName,
2424
fileInfo_->isStolen = false;
2525
}
2626

27-
UploadedFile::Impl::~Impl()
27+
void UploadedFile::Impl::cleanup()
2828
{
2929
if (!isStolen)
3030
unlink(spoolFileName.c_str());
3131
}
3232

33+
UploadedFile::Impl::~Impl()
34+
{
35+
cleanup();
36+
}
37+
3338
const std::string& UploadedFile::spoolFileName() const
3439
{
3540
return fileInfo_->spoolFileName;

src/Wt/StdGridLayoutImpl.C

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,6 @@ void StdGridLayoutImpl::setHint(const std::string& name,
349349
<< "WGridLayout: unrecognized hint '" << name << "'";
350350
}
351351

352-
int StdGridLayoutImpl::additionalVerticalPadding(bool fitWidth, bool fitHeight)
353-
const
354-
{
355-
return 0;
356-
}
357-
358352
DomElement *StdGridLayoutImpl::createDomElement(bool fitWidth, bool fitHeight,
359353
WApplication *app)
360354
{
@@ -502,9 +496,19 @@ DomElement *StdGridLayoutImpl::createDomElement(bool fitWidth, bool fitHeight,
502496
|| (totalRowStretch == 0);
503497

504498
for (int i = 0; i < item.rowSpan_; ++i) {
499+
// FIXME: if we span multiple rows, it is not clear what we should
500+
// do ?
501+
//
502+
// if stretch == -1 or >0, then we should fit height
503+
// if stretch == 0, then we should not fit height if no row
504+
// stretch is set (in which case JavaScript will actively take
505+
// over anyway)
505506
if (grid_.rows_[row + i].stretch_)
506507
itemFitHeight = true;
508+
else if (!stretch)
509+
itemFitHeight = false;
507510
for (int j = 0; j < item.colSpan_; ++j) {
511+
// there is no special meaning for column stretches
508512
if (grid_.columns_[col + j].stretch_)
509513
itemFitWidth = true;
510514
if (i + j > 0)
@@ -518,9 +522,7 @@ DomElement *StdGridLayoutImpl::createDomElement(bool fitWidth, bool fitHeight,
518522
// if we do, this makes the row no longer react to reductions
519523
// in height... Which is worse? I think the former?
520524
//
521-
// Changed now: use stretch = -1 to force fitting height
522-
//
523-
// itemFitHeight = true;
525+
// Solved now: use stretch = -1 to force fitting height
524526

525527
AlignmentFlag hAlign = item.alignment_ & AlignHorizontalMask;
526528
AlignmentFlag vAlign = item.alignment_ & AlignVerticalMask;
@@ -563,13 +565,9 @@ DomElement *StdGridLayoutImpl::createDomElement(bool fitWidth, bool fitHeight,
563565
if (!jsHeights)
564566
td->setAttribute("class", "Wt-grtd");
565567

566-
int additionalVerticalPadding = 0;
567-
568568
if (item.item_) {
569569
DomElement *c = getImpl(item.item_)
570570
->createDomElement(itemFitWidth, itemFitHeight, app);
571-
additionalVerticalPadding = getImpl(item.item_)
572-
->additionalVerticalPadding(itemFitWidth, itemFitHeight);
573571

574572
if (hAlign == 0)
575573
hAlign = AlignJustify;
@@ -619,7 +617,7 @@ DomElement *StdGridLayoutImpl::createDomElement(bool fitWidth, bool fitHeight,
619617

620618
//style2 += "overflow:auto;";
621619

622-
int padding2 = padding[2] + additionalVerticalPadding;
620+
int padding2 = padding[2];
623621

624622
if (padding[0] == padding[1] && padding[0] == padding2
625623
&& padding[0] == padding[3]) {

src/Wt/StdGridLayoutImpl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class StdGridLayoutImpl : public StdLayoutImpl
2828

2929
virtual DomElement *createDomElement(bool fitWidth, bool fitHeight,
3030
WApplication *app);
31-
virtual int additionalVerticalPadding(bool fitWidth, bool fitHeight) const;
3231

3332
static bool useJavaScriptHeights(WApplication *app);
3433

src/Wt/StdLayoutItemImpl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ class StdLayoutItemImpl : public WLayoutItemImpl, public WObject
3434
virtual void containerAddWidgets(WContainerWidget *container) = 0;
3535
virtual DomElement *createDomElement(bool fitWidth, bool fitHeight,
3636
WApplication *app) = 0;
37-
virtual int additionalVerticalPadding(bool fitWidth, bool fitHeight)
38-
const = 0;
3937
};
4038

4139
}

src/Wt/StdWidgetItemImpl.C

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ void StdWidgetItemImpl::containerAddWidgets(WContainerWidget *container)
3838
container->addWidget(item_->widget());
3939
}
4040

41-
int StdWidgetItemImpl::additionalVerticalPadding(bool fitWidth, bool fitHeight)
42-
const
43-
{
44-
return 0;
45-
}
46-
4741
DomElement *StdWidgetItemImpl::createDomElement(bool fitWidth, bool fitHeight,
4842
WApplication *app)
4943
{
@@ -95,10 +89,15 @@ DomElement *StdWidgetItemImpl::createDomElement(bool fitWidth, bool fitHeight,
9589
|| d->type() == DomElement_TEXTAREA)
9690
d->setProperty(PropertyStyleHeight, "100%");
9791

92+
// on IE, a select is reduced to width 0 when setting width: 100% when nothing
93+
// else in that column takes up space: that is a very bad thing...
9894
if (fitWidth && d->getProperty(PropertyStyleWidth).empty()) {
9995
if ((d->type() == DomElement_BUTTON
100-
|| d->type() == DomElement_INPUT
101-
|| d->type() == DomElement_SELECT
96+
|| (d->type() == DomElement_INPUT
97+
&& d->getAttribute("type") != "radio"
98+
&& d->getAttribute("type") != "checkbox")
99+
|| (d->type() == DomElement_SELECT
100+
&& !app->environment().agentIsIE())
102101
|| d->type() == DomElement_TEXTAREA))
103102
d->setProperty(PropertyStyleWidth, "100%");
104103
}

src/Wt/StdWidgetItemImpl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class StdWidgetItemImpl : public StdLayoutItemImpl
2929
virtual void containerAddWidgets(WContainerWidget *container);
3030
virtual DomElement *createDomElement(bool fitWidth, bool fitHeight,
3131
WApplication *app);
32-
virtual int additionalVerticalPadding(bool fitWidth, bool fitHeight) const;
3332

3433
virtual void setHint(const std::string& name, const std::string& value);
3534

0 commit comments

Comments
 (0)