Jump to content

[4.6 Beta] Scroll slider issue.


Recommended Posts

It looks like this now with 4.6.

unknown.png

 

The dots are the arrows. All I did was create a TextArea Widget and added text to it.

		ConsoleWindow(const std::string& pWinTitle)
		{
			m_pWindow = ENGINE_NAMESPACE::Window::Create(pWinTitle, 0, 0, 600, 600, ENGINE_NAMESPACE::Window::Titlebar + ENGINE_NAMESPACE::Window::Center, GetWindow());
			m_pGUI = GUI::Create(m_pWindow);
			m_pGUI->GetBase()->SetScript("Scripts/GUI/Panel.lua");

			m_pLogBox = Widget::TextArea(4, 4, m_pGUI->GetBase()->GetClientSize().x - 8, m_pGUI->GetBase()->GetClientSize().y - 30 - 8, m_pGUI->GetBase());
#ifdef USE_CMD
			m_pTextBox = Widget::TextField("", 4, m_pGUI->GetBase()->GetClientSize().y - 30, m_pGUI->GetBase()->GetClientSize().x - 8 - 72 - 4, 26, m_pGUI->GetBase());
			m_pSendBtn = Widget::Button("Send", m_pGUI->GetBase()->GetClientSize().x - 4 - 72, m_pGUI->GetBase()->GetClientSize().y - 30, 72, 26, m_pGUI->GetBase());
#endif

#ifdef WIN32
			std::string header = "Reep Softworks - Leadwerks Console App (" + std::string(__DATE__) + ")";
#else
			std::string header = "Reep Softworks - Leadwerks Console App";
#endif

			m_pLogBox->AddText(header);

			size = 0;
			UpdateTextBox();
		}

 

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

I'm trying to figure this out. This code works fine:
 

local window = Window:Create()
local context = Context:Create(window)
local gui = GUI:Create(context)
local base = gui:GetBase()
base:SetScript("Scripts/GUI/Panel.lua")

x=20
y=20
local sep=30

widget = Widget:Slider(x,y,300,20,base)
widget:SetStyle(SLIDER_SCROLLBAR)
y=y+sep

widget = Widget:Slider(x,y,300,20,base)
widget:SetStyle(SLIDER_TRACKBAR)
y=y+sep

widget = Widget:Slider(x,y,40,20,base)
widget:SetStyle(SLIDER_STEPPER)
y=y+sep*1.5

widget = Widget:Slider(x,y,20,150,base)
widget:SetStyle(SLIDER_VERTICAL+SLIDER_SCROLLBAR)
x=x+sep

widget = Widget:Slider(x,y,20,150,base)
widget:SetStyle(SLIDER_VERTICAL + SLIDER_TRACKBAR)
x=x+sep

widget = Widget:Slider(x,y,20,40,base)
widget:SetStyle(SLIDER_VERTICAL + SLIDER_STEPPER)
x=x+sep

while true do
        if window:Closed() then return end
        if window:KeyHit(Key.Escape) then return end
        
        while EventQueue:Peek() do
                local event = EventQueue:Wait()
                if event.id == Event.WidgetAction then
                        System:Print("WidgetAction")
                elseif event.id == Event.WidgetSelect then
                        System:Print("WidgetSelect")
                end             
        end
        
        context:Sync()
end

 

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Yep, that code loads fine. (Linux too!) I think it's something with the TextArea script exclusively. Noticed that I'm just calling Widget::TextArea without a script. Does the engine call the TextArea.lua script automatically?

 

image.thumb.png.339c2696fe0653e1750820b3371cdc2d.png

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...