Scrollview - scrolling using scroll wheel or hold and drag?

#1

Is it possible in scrollview to use mouse scorll wheel or just hold button ( click ) and drag in some direction ( up / down ) ?
At the moment this is possible only when mouse is over Button component ( in Scrollview ) , but not on Label or empty screen ( part of VBox or HBox ) . Maybe is possible VBox / HBox in ScrollView to be scrollable too ?

#2

Could this be an openfl (i think flash too) thing? If you give the contents of you scrollview a background colour does it work then?

#3

Setting background color works. Before I was test flash ( without background color ) and it works. The problem was only with html5 target.

#4

So does that mean there is a discrepancy between openfl and flash? I was under the impression that in openfl (and flash / as3) that a sprite doesnt receive mouse events if it doesnt have anything drawn into it? Is that not the case in flash? What about openfl (nothing to do with haxeui, just normal openfl sprites)

#5

You are right. It’s not possible to click on transparent area in flash too.
What is different between html5 and flash target ( haxeui-openfl ) is scrolling when the mouse cursor is over the Label .
On html5 nothing happens, but on flash target scrolling works.
So it should always set background color for correct scrolling.
Thank you.

#6

So is this an openfl discrepency? Or a problem in haxeui-openfl?

One think you can do is:

.label {
    background-color: white;
    background-opacity: 0;
}

Ive used this before on openfl (HaxeUI v1), which means all labels will have a 0x00FFFFFF background drawn, but i dont think this should be in haxeui-core (or even haxeui-openfl) as im sure there is some perf impact for this.

Thoughts / suggestions more than welcome here, never known what to do here with openfl, but i dont use it very much anymore so assumed “standard behavior” was fine?

Ian

#7

Well, maybe is some openfl discrepency , because label scrolling on flash works, but on html5 didn’t .

I also tried background-opacity: 0; and background-color: white; and everything work like a charm . I think you should leave it as it now.

Are you thinking about adding cookbook similar to haxe one ( https://code.haxe.org/ ) for such nifty examples ?

1 Like
#8

@ianharrigan I just upgrade to the latest new-component-model ( haxeui-core , haxeui-openfl and also install haxeui-html5) and have some weird errors.

  1. For haxeui-openfl target

… /haxeui-openfl/ … haxe/ui/backend/EventBase.hx:4: characters 8-28 : Type not found : haxe.ui.core.UIEvent

  1. For haxeui-html5

haxe.ui.containers.ScrollView has no field x
haxe.ui.containers.ScrollView has no field y
haxe.ui.containers.ScrollView has no field addEventListener

About addEventListner I was added just for test and it works for openfl target.

#9

I saw you changed some package names, so I fixed in openfl target , but this remain as a problem:

/haxeui-core/git/haxe/ui/core/TextInput.hx:41: characters 9-20 : haxe.ui.backend.TextInputBase has no field focus

/haxeui-core/git/haxe/ui/core/TextInput.hx:40: lines 40-42 : Field focus is declared ‘override’ but doesn’t override any field

/haxeui-core/git/haxe/ui/core/TextInput.hx:45: characters 9-19 : haxe.ui.backend.TextInputBase has no field blur

/haxeui-core/git/haxe/ui/core/TextInput.hx:44: lines 44-46 : Field blur is declared ‘override’ but doesn’t override any field

/haxeui-core/git/haxe/ui/util/ImageLoader.hx:41: characters 17-46 : haxe.ui.ToolkitAssets has no field imageFromBytes

#10

Hi, so the UIEvent one is a little strange i moved those files around, but i was pretty sure i tested it before committing - is that error coming from your app? Or haxeui-openfl backend? (the events have moved to haxe.ui.events from haxe.ui.core)

As for the other one, you are using openfl functions / properties… now, you can use this functions if you want, but its not really the recommended way of doing things as they arent cross framework. The only reason you can see them in haxeui-openfl is because Component -> ComponentBase -> Sprite.

So the recommend functions are as follows:

x => left
y => top
addEventListener => registerEvent

Hope that helps somewhat.

Ian

1 Like
#11

@ianharrigan sorry. I update again haxeui-openfl target and everything works now. Sorry again

1 Like
#12

top and left works for html target. I have one additional question about async loading of images, but will open new topic . When you have time you can check it. Sorry for taking your time.