# Form/Window Controller - Source Code File
load "bookslibraryView.ring"
import System.GUI
if IsMainSourceFile() {
new App {
StyleFusionblack()
openWindow(:bookslibraryController)
exec()
}
}
class bookslibraryController from windowsControllerParent
oView = new bookslibraryView
posme()
func Search
oView {
}
func posme()
oView {
screenW = wid.screen().width()
screenh = wid.screen().height()
formw = win.width()
formh = win.height()
x = (screenw-formw)/2
y = (screenh-formh)/2
win.move(x,y)
}
private
wid = new qDesktopwidget()
can anyone figure out what is wrong
thanks
screenW = wid.width()
screenh = wid.height()
Solution [1]
Use this
screenW = this.wid.width()
screenh = this.wid.height()
screenW = wid.width()
screenh = wid.height()
Greetings,class bookslibraryController from windowsControllerParent
oView = new bookslibraryView
pCenter
func Search
oView {
}
func pCenter()
screenW = wid.width()
screenh = wid.height()
// //
oView {
formw = win.width()
formh = win.height()
x = (screenw-formw)/2
y = (screenh-formh)/2
win.move(x,y)
}
private
wid = new qDesktopwidget()
oView = new bookslibraryView
pCenter
oView = new bookslibraryView
pCenter()
i.e. Add () after pCenter to indicate that you are calling a method, not defining an attribute
Greetings,
Mahmoud
# Form/Window Controller - Source Code File
load "bookslibraryView.ring"
import System.GUI
if IsMainSourceFile() {
new App {
StyleFusionblack()
openWindow(:bookslibraryController)
exec()
}
}
class bookslibraryController from windowsControllerParent
oDesktop = new qDesktopWidget()
oView = new bookslibraryView
Center_the_Window()//لوضع النافذة في وسط الشاشة والتركيز في مربع البحث
Func Center_the_Window
oView.win {
move((this.oDesktop.Width()-Width())/2,(this.oDesktop.Height()-Height())/2)
}
oView.lineedit1.setfocus(0)//التركيز على مربع البحث
oView.lineedit1.selectall() // تحديد النص في مربع البحث
Func pDownload
manager = null
oUrl = new QUrl("http://ring-lang.sourceforge.net")
request = new qNetworkRequest(oUrl)
request.setrawheader(new qbytearray().append("User-Agent"), new qbytearray().append("Application"))
manager = new qNetworkAccessManager(oView.win)
{
setfinishedevent("pfinish()")
}
manager.getvalue(request)
Func pfinish
reply = new qNetworkReply { pObject = manager.getEventParameters()[1] }
see reply.readall().data()
can someone help
alaa