Parameter panel

Is there a way to control the divider between the parameters and output section with code(rather then dragging it).
Just a small thing but I’d love to use code to have the output portion smaller when the code runs. I know it only saves me from sliding it down to access the parameters, but I do that an awful lot. Would be a great QOL improvement to be able to default it to minimal.

@bitimage - you could try building your own. Ages ago I started building my own moveable/resizable window to hold purpose built controls in a window that could be minimised to a button but never finished it. I still think it could be a good project - I’ll try to dig out my code but don’t hold your breath.

That’s actually a great idea. I’d have had to add legit onscreen ctrl’s at some point anyhow. I might as well bash something together to tide me over. And then just hide the parameter panel from the get go. I suppose I’ve been using it as a crutch for too long.

might it be possible to get the parameter view from the objc bindings and manipulate it through code that way?

@skar - so far only found a simple outline, sure I got much further than this. Will keep digging. This demo was just to get a dragable window.


-- SidebarPlus

displayMode(FULLSCREEN)
function setup()
    --
    box = DragMe()
end

function draw()
    background(76, 178, 198, 255)
    ellipse(200,200,300,300)      
    box:draw()
end

function touched(touch)
    box:touched(touch)
end

-- Part 2:

-- DragMe class from the Codea example
DragMe = class()

function DragMe:init()
    self.pos = vec2(200,300)
    self.wide = 200
    self.high = 424
end

function DragMe:draw()
    pushStyle()
    
    -- ====================================================
    -- draw the menu rectangle
    strokeWidth(5)
    stroke(190, 47, 47, 255)
    fill(226, 219, 219, 255)
    rectMode(CENTER)
    rect(self.pos.x, self.pos.y, self.wide, self.high)
    -- ====================================================
    -- draw the main menu bar and close button
    strokeWidth(40)
    linhi = self.pos.y + 260
    linstart = self.pos.x - self.wide/2
    linend = self.pos.x + self.wide/2
    lineCapMode(SQUARE)
    line(linstart, linhi, linend, linhi)
    fill(45, 41, 57, 255)
    text("Codea Menu",linstart + 100, linhi)
    stroke(110, 51, 109, 255)
    ellipse(linstart + 20, linhi, 30, 30)
    -- ====================================================
    -- draw the parameter menu bar and the open/collapse button
    strokeWidth(40)
    linhi = self.pos.y + 224
    linstart = self.pos.x - self.wide/2
    linend = self.pos.x + self.wide/2
    stroke(190, 47, 47, 255)
    lineCapMode(SQUARE)
    line(linstart, linhi, linend, linhi)
    fill(45, 41, 57, 255)
    text("Parameters",linstart + 60, linhi)
    stroke(195, 206, 30, 255)
    ellipse(linstart + 170, linhi, 30, 30)
    strokeWidth(3)
    stroke(0)
    text("linhi                     376", linstart + 100, linhi -40)
    line(linstart + 24, linhi - 60, linend - 40, linhi - 60) 
    ellipse(linstart + 84, linhi - 60, 12, 12)   
    -- ====================================================
    -- draw the watch variable menu bar and the open/collapse button
    strokeWidth(40)
    linhi = self.pos.y + 80
    linstart = self.pos.x - self.wide/2
    linend = self.pos.x + self.wide/2
    stroke(190, 47, 47, 255)
    lineCapMode(SQUARE)
    line(linstart, linhi, linend, linhi)
    fill(45, 41, 57, 255)
    text("Watch Variables",linstart + 80, linhi)
    stroke(195, 206, 30, 255)
    ellipse(linstart + 170, linhi, 30, 30)
    text("Menu X:  "..linstart, linstart + 80, linhi - 40)
    text("Menu Y:  "..linhi, linstart + 80, linhi - 80)    
    -- ====================================================  
    -- draw the code tracing menu bar and the open/collapse button            
    strokeWidth(40)
    linhi = self.pos.y - 80
    linstart = self.pos.x - self.wide/2
    linend = self.pos.x + self.wide/2
    stroke(190, 47, 47, 255)
    lineCapMode(SQUARE)
    line(linstart, linhi, linend, linhi)
    fill(45, 41, 57, 255)
    text("Code Tracing",linstart + 80, linhi)
    stroke(195, 206, 30, 255)
    ellipse(linstart + 170, linhi, 30, 30)
    -- ====================================================   
    -- draw the code tracing button bar
    -- including forward/back/skip/stop/pause buttons    
    strokeWidth(40)
    linhi = self.pos.y - 116
    linstart = self.pos.x - self.wide/2 + 4
    linend = self.pos.x + self.wide/2 - 4
    stroke(208, 172, 94, 255)
    lineCapMode(SQUARE)
    line(linstart, linhi, linend, linhi)
    for loop = 1, 4 do
        stroke(46, 35, 153, 255)
        rect(linstart + loop*40, linhi, 30, 30)
    end
    -- ====================================================
    -- draw the Codea control menu bar and the open/collapse button         
    strokeWidth(40)
    linhi = self.pos.y - 152
    linstart = self.pos.x - self.wide/2
    linend = self.pos.x + self.wide/2
    stroke(190, 47, 47, 255)
    lineCapMode(SQUARE)
    line(linstart, linhi, linend, linhi)
    fill(45, 41, 57, 255)
    text("Codea Controls",linstart + 80, linhi)
    stroke(195, 206, 30, 255)
    ellipse(linstart + 170, linhi, 30, 30)
    -- ====================================================  
    -- draw the standard Codea control buttons including
    -- program end/pause/camera/video              
    strokeWidth(40)
    linhi = self.pos.y - 188
    linstart = self.pos.x - self.wide/2 + 4
    linend = self.pos.x + self.wide/2 - 4
    stroke(208, 172, 94, 255)
    lineCapMode(SQUARE)
    line(linstart, linhi, linend, linhi)  
    for loop = 1, 4 do
        stroke(46, 35, 153, 255)
        rect(linstart + loop*40, linhi, 30, 30)
    end
    
    popStyle()
end

function DragMe:hit(point)
    if point.x > (self.pos.x - self.wide/2) and
    point.x < (self.pos.x + self.wide/2) and
    point.y > (self.pos.y - self.high/2) and
    point.y < (self.pos.y + self.high/2) then
        return true
    end        
    return false
end

function DragMe:touched(touch)
    if self:hit( vec2(touch.x, touch.y) ) and
    touch.state == MOVING then
        self.pos = self.pos + vec2( touch.deltaX, touch.deltaY )
    end
end