Skip to content

Commit

Permalink
Move gxl.topmostview
Browse files Browse the repository at this point in the history
  • Loading branch information
SerVB committed Jul 4, 2018
1 parent 3083ee3 commit a31fcd8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.github.servb.pph.gxlib.gxltopmostview

import com.github.servb.pph.gxlib.gxlmetrics.Point
import com.github.servb.pph.gxlib.gxlmetrics.Rect
import com.github.servb.pph.gxlib.gxlview.VIEWCLSID
import com.github.servb.pph.gxlib.gxlview.iView
import com.github.servb.pph.gxlib.gxlviewmgr.iViewMgr

class iTopmostView(pViewMgr: iViewMgr) : iView(
pViewMgr,
Rect(pViewMgr.Metrics()),
VIEWCLSID.GENERIC_VIEWPORT,
0,
ViewState.Visible.v or ViewState.Enabled.v
) {

// Message handler
fun ProcessMessage(msg: iInput.iEntry): Boolean {
when (msg.taskType) {
iInput.iEntry.MouseMove -> MouseTrack(Point(msg.px, msg.py))
iInput.iEntry.MouseDown -> MouseDown(Point(msg.px, msg.py))
iInput.iEntry.MouseUp -> MouseUp(Point(msg.px, msg.py))
iInput.iEntry.KeyDown -> KeyDown(msg.key)
iInput.iEntry.KeyUp -> KeyUp(msg.key)
}
return true;
}
fun KeyDown(key: Int): Boolean = OnKeyDown(key)
fun KeyUp(key: Int): Boolean = OnKeyUp(key)

override fun OnKeyDown(key: Int) = false
override fun OnKeyUp(key: Int) = false
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.servb.pph.gxlib.gxlview

import com.github.servb.pph.gxlib.gxlmetrics.*
import com.github.servb.pph.gxlib.gxlviewmgr.iViewMgr
import com.github.servb.pph.util.staticFunction.Tracer

enum class VIEWCLSID {
Expand Down

0 comments on commit a31fcd8

Please sign in to comment.