more fixes

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-04-05 19:33:31 -05:00
parent a881d87108
commit 65f4d0e231
3 changed files with 18 additions and 18 deletions

View File

@ -46,16 +46,17 @@ func (w *cuiWidget) showWidgetPlacement(b bool, s string) {
pId = w.parent.id
}
s1 = fmt.Sprintf("(wId,pId)=(%2d,%2d) ", w.id, pId)
s1 += fmt.Sprintf("W,H()=(%2d,%2d) ", w.startW, w.startH)
s1 += fmt.Sprintf("start()=(%2d,%2d) ", w.startW, w.startH)
s1 += fmt.Sprintf("size()=(%2d,%2d) ", w.realWidth, w.realHeight)
s1 += fmt.Sprintf("gocui()=(%2d,%2d,%2d,%2d,%2d,%2d) ",
w.gocuiSize.startW, w.gocuiSize.startH,
w.gocuiSize.width, w.gocuiSize.height,
w.gocuiSize.w0, w.gocuiSize.h0, w.gocuiSize.w1, w.gocuiSize.h1)
switch w.widgetType {
case toolkit.Grid:
s1 += fmt.Sprintf("next()=(%2d,%2d)", w.nextW, w.nextH)
default:
s1 += fmt.Sprintf("L()=(%2d,%2d,%2d,%2d)",
w.logicalSize.w0, w.logicalSize.h0, w.logicalSize.w1, w.logicalSize.h1)
// s1 += fmt.Sprintf("L()=(%2d,%2d,%2d,%2d)",
// w.logicalSize.w0, w.logicalSize.h0, w.logicalSize.w1, w.logicalSize.h1)
}
log(b, s1, s, w.widgetType, ",", w.name) // , "text=", w.text)

View File

@ -37,23 +37,24 @@ func (w *cuiWidget) setStartWH() {
case toolkit.Box:
w.isFake = true
w.setFake()
w.getBoxWH()
w.setWH()
w.showWidgetPlacement(logNow, "StartWH:")
return
case toolkit.Grid:
w.isFake = true
w.setFake()
w.showWidgetPlacement(logNow, "StartWH:")
}
p := w.parent
switch p.widgetType {
case toolkit.Box:
w.getBoxWH()
return
case toolkit.Grid:
w.getGridWH()
w.setWH()
w.showWidgetPlacement(logNow, "StartWH:")
return
case toolkit.Group:
w.getGroupWH()
w.setWH()
w.showWidgetPlacement(logNow, "StartWH:")
return
default:
w.setWH()
}
}
@ -64,9 +65,8 @@ func Action(a *toolkit.Action) {
case toolkit.Add:
w = setupWidget(a)
w.setStartWH()
w.moveTo(w.startW, w.startH)
// w.moveTo(w.startW, w.startH)
w.drawView()
// findPlace(w)
case toolkit.Show:
if (a.B) {

View File

@ -30,10 +30,9 @@ func (w *cuiWidget) textResize() {
}
height = i
}
w.realWidth = width + 3
w.realHeight = me.defaultHeight + height
w.gocuiSize.w1 = w.gocuiSize.w0 + w.realWidth
w.gocuiSize.h1 = w.gocuiSize.h0 + w.realHeight
w.gocuiSize.width = width + 3
w.gocuiSize.height = me.defaultHeight + height
w.setWH()
w.showWidgetPlacement(logNow, "textResize()")
}