Skip to content

Commit

Permalink
jx_layout_editor: selectable StaticText should recognize its scrollba…
Browse files Browse the repository at this point in the history
…r set
  • Loading branch information
jafl committed May 1, 2024
1 parent b886695 commit f3dc5dc
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tools/jx_layout_editor/code/StaticText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "StaticText.h"
#include "StaticTextPanel.h"
#include "LayoutContainer.h"
#include "ScrollbarSet.h"
#include <jx-af/jx/JXStaticText.h>
#include <jx-af/jcore/jGlobals.h>
#include <jx-af/jcore/jAssert.h>
Expand Down Expand Up @@ -210,15 +211,40 @@ StaticText::PrintCtorArgsWithComma
)
const
{
ScrollbarSet* scrollbarSet = nullptr;

JXContainer* p = GetEnclosure();
while (p != nullptr)
{
auto* widget = dynamic_cast<LayoutWidget*>(p);
if (widget != nullptr)
{
scrollbarSet = dynamic_cast<ScrollbarSet*>(widget);
break;
}
p = p->GetEnclosure();
}

PrintStringForArg(itsText->GetText()->GetText(), varName, stringdb, output);
output << ", ";

if (itsWordWrapFlag || itsSelectableFlag || itsStyleableFlag)
{
bool b1, b2;

output << itsWordWrapFlag << ", ";
output << itsSelectableFlag << ", ";
output << itsStyleableFlag << ", ";
output << "nullptr, "; // JXScrollbarSet

if (scrollbarSet != nullptr)
{
scrollbarSet->GetVarName(&b1, &b2).Print(output);
}
else
{
output << "nullptr";
}
output << ", ";
}
}

Expand Down

0 comments on commit f3dc5dc

Please sign in to comment.