increase width of com.googlecode.mgwt.ui.client.widget.HeaderButton in mgwt 1.1.2 - mgwt

HeaderButton.setWidth("80px");
seems to have no effect.
HeaderButton.addStyleName("myStyle"); with ".myStyle {width:80px;}" in css neither. But the css is active which is proven by the fact that the following has an effect, but no nice one:
HeaderButton.setStyleName("myStyle");
With setStyleName, the width is indeed increased but the rendering is as if the button width had not increased, i.e. the round border is inside the button which looks funny.
Is there a simple way to increase the width of a left header button just by some pixels so that I can see the German "Abbrechen" (means Cancel) complete? :)
Thanks in advance

After some trials I have found a solution.
It appears, one has just to inject an own HeaderCss instance at the beginning of onModuleLoad(). The style defined there seems to work then for all HeaderPanels and their buttons.
My example is as follows.
IIntroductionBundle.java:
package com.rlogix.tourneys.client.view.introduction;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.googlecode.mgwt.ui.client.theme.base.HeaderCss;
public interface IIntroductionBundle extends ClientBundle {
public static IIntroductionBundle I = GWT.create(IIntroductionBundle.class);
#Source("header.css")
HeaderCss headerCss();
}
and header.css:
#CHARSET "ISO-8859-1";
.mgwt-HeaderButton {
}
.mgwt-HeaderButton-active {
}
.mgwt-HeaderButton-back {
}
.mgwt-HeaderButton-forward {
}
.mgwt-HeaderButton-round {
}
.mgwt-HeaderButton-text {
max-width:80px;
}
.mgwt-HeaderButton-border-container {
}
.mgwt-HeaderButton-border-content {
}
.mgwt-HeaderPanel {
}
.mgwt-HeaderPanel-left {
margin:6px;
margin-left:0px;
}
.mgwt-HeaderPanel-center {
}
.mgwt-HeaderPanel-right {
}
.mgwt-DropDownMenu {
}
.mgwt-DropDownMenu-content {
}
.mgwt-DropDownMenu-arrow {
}
Maybe this helps somebody...

Related

Is in JobRunr an AfterFinallyFailedHook

After a job failed finally no matter if it's out of retries or it's a ProblematicExceptionAndMustNotRetry, I want to react on it.
Is there any hook I haven't seen so far?
Currently I'm using a CustomRetryFilter as follows:
public class CustomRetryFilter extends RetryFilter {
#Override
public void onStateElection(Job job, JobState newState) {
if (this.isFailed(newState)) {
if (!this.isProblematicExceptionAndMustNotRetry(newState)
&& !this.maxAmountOfRetriesReached(job)) {
job.scheduleAt(Instant.now().plusSeconds(this.getSecondsToAdd(job)),
String.format("Retry %d of %d", this.getFailureCount(job), this.getMaxNumberOfRetries(job)));
} else {
// Publish event
}
}
}
}
What is best practice for such a scenario?
No, this is currently the way to do it.
I'll add a feature request for it.

How to collect user speech input for global usage?

I am looking to pass/store user's speech input. Bixby gives the user a result-view list of items, of which the user will say what item they want. Bixby will then display a list of account names, of which the user will say what account. I want to store what the user says after each list to combine them for an API call later.
Currently, I have only created the lists Bixby displays after each user input, but I do not know how to go forward to use both of the user inputs to use in a API call. My authorization.bxb is all configured and works, it is strictly only being able to forward information from multiple "moments." I have tried creating a input-view using selection-of, but continued to have issues displaying a list.
PossibleDataMetrics.view.bxb
result-view {
match: Metric (metric) {
from-output: ListMetrics
}
message {
template ("What data metrics are you looking for?")
}
render {
layout {
section {
content {
partitioned {
content {
for-each (metric){
as (m) {
title-area {
slot1 {
text {
value ("#{value(m.metrics)}")
style (Title_S)
}
}
}
}
}
}
}
}
}
}
}
}
ProfileTitleCardResultView.view.bxb
result-view {
match: Profile (profile) {
from-output: GetProfiles
}
message {
template ("What profile would you like?")
}
render {
layout {
section {
content {
for-each (profile){
as (view) {
title-card {
title-area {
halign (Start)
slot1 {
single-line {
text {
style (Detail_L_Soft)
value ("Account: #{value(view.acctName)}")
}
}
}
slot2 {
single-line {
text {
style (Detail_M_Soft)
value ("Web property: #{value(view.webName)}")
}
}
}
slot3 {
single-line {
text {
style (Title_S)
value ("Profile: #{value(view.viewName)}")
}
}
}
}
}
}
}
}
}
}
}
}
When these result views are called, I am looking to take the user input from both of these list of results to use in another action to create another list that is based off the user's answer of the initial 2 results.
In general, To navigate away from result-view you have the following options
Use followup to pose a question to the user and use the answer to
navigate away from the result-view https://bixbydevelopers.com/dev/docs/reference/type/result-view.followup
Use on-click feature of cards https://bixbydevelopers.com/dev/docs/reference/type/layout-macro-def.content.map-card.on-click
The other way to accomplish the same is by calling an Action that collects these inputs which invokes the input-view for each of these.
Hope this helps!

geb.page content module cannot be resolved

Hi i tried to do a NavigationModule to acces to my content in geb.page, but when i want to instance from this navigation 'module' cannot be resolved by intellij
class NavigationModule extends Module{
static content = {
homeLink { $("a", title:"Home") }
contactLink { $("a", title:"Contact Us") }
}
}
class HomePage extends Page{
static url = "http://www.websitetest.com"
static at={
assert $("h1").text() == "Test website speed and performance"
}
static content = {
navBar {module NavigationModule}
//loginLink { $("a", text: "login")[0]}
}
}
and also I can't access from my script
void test() {
Browser.drive() {
to HomePage
navBar.
}
}
someone know what happen? I spent a lot of time searching in google but i don't find anything
thanks in advance
The Geb doc (http://www.gebish.org/manual/current/ide-and-typing.html#strong_typing) recommends to expecitly define Types to have a better IDE support.
With this example code completion works for me.
class HomePage extends Page {
static url = "http://www.websitetest.com"
static at={
assert $("h1").text() == "Test website speed and performance"
}
static content = {
navBar {module NavigationModule}
//loginLink { $("a", text: "login")[0]}
}
// explicitly define getter to give IntelliJ more type information
NavigationModule getNav() {
navBar
}
}
Test script:
void test() {
Browser.drive() {
// assign to page in order to have code completion on page
page = to HomePage
// code completin for homeLink works
navBar.homeLink
}
}

Repeating (menu) background in HaxeFlixel?

I've tried to load a 16x16 image as a FlxSprite, but I don't know how to make it repeat to span across the whole Window. How would I do that?
Where I load the sprite:
class MainMenuState extends FlxState {
var _menuBg:FlxSprite;
override public function create ():Void {
_menuBg = new FlxSprite(16, 16, 'assets/img/block1_16.png');
add(_menuBg);
super.create();
}
override public function destroy ():Void {
super.destroy();
}
override public function update ():Void {
super.update();
}
}
You can use a FlxBackdrop (from flixel-addons) for that.

Monotouch MKMapView UIGestureRecognizer problems

I added 3 gesture recognizers to my MapView in IB, a long press, a pan & a pinch. Their delegate is the file's owner. I set them up like so -
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
PanGestureRecognizer.AddTarget(s => { Console.WriteLine("Pan"); } );
LongPressGestureRecognizer.AddTarget(s => { Console.WriteLine("Long press"); } );
PinchGestureRecognizer.AddTarget(s => { Console.WriteLine("Pinch"); } );
}
I also implement this -
public bool ShouldRecognizeSimultaneously (UIGestureRecognizer gestureRecognizer, UIGestureRecognizer otherGestureRecognizer)
{
return true;
}
The problem is, only the Long Press gesture recognizer does anything, the others are completely ignored.
Any ideas/suggestions welcome!
Being fairly new to Monotouch, I didn't realise that when I set the delegate of the MapView in IB to my ViewController, that wouldn't actually work. I needed to create a delegate which is a subclass of UIGestureRecognizerDelegate, and set the delegate of the gestureRecognizer to this, and I added the gestureRecognizer programmatically (though that's probably not necessary) -
private class GestureRecognizerDelegate : UIGestureRecognizerDelegate
{
public override bool ShouldRecognizeSimultaneously (UIGestureRecognizer gestureRecognizer, UIGestureRecognizer otherGestureRecognizer)
{
return true;
}
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
UIPinchGestureRecognizer pinchGestureRecognizer = new UIPinchGestureRecognizer(s => { /* do stuff here */ } );
GestureRecognizerDelegate gestureRecognizerDelegate = new GestureRecognizerDelegate();
pinchGestureRecognizer.Delegate = gestureRecognizerDelegate;
MapView.AddGestureRecognizer(pinchGestureRecognizer);
}
Then, by setting the ZoomEnabled property of the MapView to false, I can control how the map zooms (in my case, I had to prevent the map zooming in beyond a certain threshold, my client wasn't happy with the way you could zoom in & it would then bounce back out to my preset value, which I had working using RegionChanged in the MapView delegate). Don't you love clients!

Resources