func Createwinsewa(Theme gxui.Theme, arrdata []data.Anakkost) Winsewa {
	var hasil Winsewa
	Layoutbase := Theme.CreateLinearLayout()
	layoutbutton := Theme.CreateLinearLayout()
	layoutbutton.SetDirection(gxui.LeftToRight)
	layoutjumlah := Theme.CreateLinearLayout()
	layoutjumlah.SetDirection(gxui.LeftToRight)

	hasil.Window = Theme.CreateWindow(500, 500, "SEWA")
	hasil.Daftaruianakkost = Semuabaris(Theme, arrdata)

	hasil.buttonsave = Theme.CreateButton()
	hasil.buttonsave.SetText("SAVE")
	btnjumlah := Theme.CreateButton()
	btnjumlah.SetText("JUMLAHKAN")

	labeljumlah := Theme.CreateLabel()
	labeljumlah.SetText("Jumlah:")
	labelnama := Theme.CreateLabel()
	labelnama.SetText("NAMA")
	labelsewa := Theme.CreateLabel()
	labelsewa.SetText("SEWA")
	labelcatatan := Theme.CreateLabel()
	labelcatatan.SetText("CATATAN")

	btnjumlah.OnClick(jumlahonclick)

	tbjumlah = Theme.CreateTextBox()

	var buttonsaveclick = func(e gxui.MouseEvent) {
		Save(hasil)
	}
	hasil.buttonsave.OnClick(buttonsaveclick)

	layoutjumlah.AddChild(btnjumlah)
	layoutjumlah.AddChild(labeljumlah)
	layoutjumlah.AddChild(tbjumlah)
	layoutbutton.AddChild(hasil.buttonsave)
	Layoutbase.AddChild(layoutbutton)
	Layoutbase.AddChild(layoutjumlah)

	LayoutTB := Theme.CreateTableLayout()
	numberrow := len(hasil.Daftaruianakkost) + 1
	LayoutTB.SetGrid(3, numberrow)

	LayoutTB.SetChildAt(0, 0, 1, 1, labelnama)
	LayoutTB.SetChildAt(1, 0, 1, 1, labelsewa)
	LayoutTB.SetChildAt(2, 0, 1, 1, labelcatatan)
	Layoutbase.AddChild(LayoutTB)

	for i := 0; i < len(hasil.Daftaruianakkost); i++ {
		LayoutTB.SetChildAt(0, i+1, 1, 1, hasil.Daftaruianakkost[i].TBNama)
		LayoutTB.SetChildAt(1, i+1, 1, 1, hasil.Daftaruianakkost[i].TBSewa)
		LayoutTB.SetChildAt(2, i+1, 1, 1, hasil.Daftaruianakkost[i].TBCatatan)
	}
	hasil.Window.AddChild(Layoutbase)
	return hasil
}
Exemple #2
0
func Createwinsetoran(Theme gxui.Theme, arrdata []data.Setoran) Winsetoran {
	var hasil Winsetoran
	hasil.Window = Theme.CreateWindow(500, 500, "SETORAN")
	layoutbase := Theme.CreateLinearLayout()
	layoutbutton := Theme.CreateLinearLayout()
	layoutbutton.SetDirection(gxui.LeftToRight)
	layoutjumlah := Theme.CreateLinearLayout()
	layoutjumlah.SetDirection(gxui.LeftToRight)

	hasil.buttonsave = Theme.CreateButton()
	hasil.buttonsave.SetText("SAVE")
	var buttonsaveclick = func(e gxui.MouseEvent) {
		Save(hasil)
	}
	hasil.buttonsave.OnClick(buttonsaveclick)

	hasil.Daftarsetoran = Semuabaris(Theme, arrdata)
	layoutbutton.AddChild(hasil.buttonsave)
	layoutbase.AddChild(layoutbutton)

	layouttabel := Theme.CreateTableLayout()
	row := len(hasil.Daftarsetoran)
	layouttabel.SetGrid(2, row+1)

	tbjumlah = Theme.CreateTextBox()
	buttonjumlah := Theme.CreateButton()
	buttonjumlah.SetText("JUMLAHKAN")
	buttonjumlah.OnClick(jumlahonclick)

	labelcatatan := Theme.CreateLabel()
	labelcatatan.SetText("CATATAN")
	labeljumlah := Theme.CreateLabel()
	labeljumlah.SetText("JUMLAH")
	labelhasiljumlah := Theme.CreateLabel()
	labelhasiljumlah.SetText("JUMLAH:")

	layoutjumlah.AddChild(buttonjumlah)
	layoutjumlah.AddChild(labelhasiljumlah)
	layoutjumlah.AddChild(tbjumlah)
	layouttabel.SetChildAt(0, 0, 1, 1, labelcatatan)
	layouttabel.SetChildAt(1, 0, 1, 1, labeljumlah)
	for i := 0; i < len(hasil.Daftarsetoran); i++ {
		layouttabel.SetChildAt(0, i+1, 1, 1, hasil.Daftarsetoran[i].TBCatatan)
		layouttabel.SetChildAt(1, i+1, 1, 1, hasil.Daftarsetoran[i].TBJumlah)
	}
	layoutbase.AddChild(layoutjumlah)
	layoutbase.AddChild(layouttabel)
	hasil.Window.AddChild(layoutbase)
	return hasil
}
Exemple #3
0
func Createwindashboard(theme gxui.Theme) gxui.Window {
	window := theme.CreateWindow(500, 500, "Dashboard")
	layoutdashboard := theme.CreateLinearLayout()
	layoutbutton := theme.CreateLinearLayout()
	layoutbutton.SetDirection(gxui.LeftToRight)
	layoutbutton.SetHorizontalAlignment(gxui.AlignLeft)
	layouttahun := theme.CreateLinearLayout()
	layouttahun.SetDirection(gxui.LeftToRight)
	layouttahun.SetHorizontalAlignment(gxui.AlignLeft)
	layoutbulan := theme.CreateLinearLayout()
	layoutbulan.SetDirection(gxui.LeftToRight)
	layoutbulan.SetHorizontalAlignment(gxui.AlignLeft)
	layoutsavenload := theme.CreateLinearLayout()
	layoutsavenload.SetDirection(gxui.LeftToRight)
	layoutsavenload.SetHorizontalAlignment(gxui.AlignLeft)
	layoutdir := theme.CreateLinearLayout()
	layoutdir.SetDirection(gxui.LeftToRight)
	layoutdir.SetHorizontalAlignment(gxui.AlignLeft)

	btneditsewa := theme.CreateButton()
	btneditsewa.SetText("Edit Sewa")
	btneditsewa.OnClick(Btneditsewabulananonclick)
	btneditpengeluaran := theme.CreateButton()
	btneditpengeluaran.SetText("Edit Pengeluaran")
	btneditpengeluaran.OnClick(Btneditpengeluaranonclick)
	btneditsetoran := theme.CreateButton()
	btneditsetoran.SetText("Edit Setoran")
	btneditsetoran.OnClick(Btneditsetoranonclick)
	btnsave := theme.CreateButton()
	btnsave.SetText("SAVE")
	btnload := theme.CreateButton()
	btnload.SetText("LOAD")

	btnsave.OnClick(Btnsaveonclick)
	btnload.OnClick(Btnloadonclick)

	tbtahun = theme.CreateTextBox()
	tbbulan = theme.CreateTextBox()
	tbdirectory = theme.CreateTextBox()

	labeltahun := theme.CreateLabel()
	labeltahun.SetText("TAHUN")
	labelbulan := theme.CreateLabel()
	labelbulan.SetText("BULAN")
	labeldirectory := theme.CreateLabel()
	labeldirectory.SetText("DIRECTORY")

	layoutbutton.AddChild(btneditsewa)
	layoutbutton.AddChild(btneditpengeluaran)
	layoutbutton.AddChild(btneditsetoran)
	layouttahun.AddChild(labeltahun)
	layouttahun.AddChild(tbtahun)
	layoutbulan.AddChild(labelbulan)
	layoutbulan.AddChild(tbbulan)
	layoutsavenload.AddChild(btnsave)
	layoutsavenload.AddChild(btnload)
	layoutdir.AddChild(labeldirectory)
	layoutdir.AddChild(tbdirectory)

	layoutdashboard.AddChild(layoutbutton)
	layoutdashboard.AddChild(layoutdir)
	layoutdashboard.AddChild(layouttahun)
	layoutdashboard.AddChild(layoutbulan)
	layoutdashboard.AddChild(layoutsavenload)

	window.AddChild(layoutdashboard)

	return window
}