• Willkommen im Geoclub - dem größten deutschsprachigen Geocaching-Forum. Registriere dich kostenlos, um alle Inhalte zu sehen und neue Beiträge zu erstellen.

[Dev] Learning Ewe Methods

Eliveras

Geocacher
Mir gefällt nicht, daß im GotoPanel die Koordinaten "GPS:" linksbündig und "Ziel:" zentriert sind, weil das zweite ein Button ist.

Jetzt wollte ich mich gerade an die Änderung machen, ich fand folgendes Codesegement verantwortlich:

Code:
		//Coords
		CoordsP.addNext(lblGPS = new mLabel("GPS: "),CellConstants.DONTSTRETCH, (CellConstants.DONTFILL|CellConstants.WEST));
		lblGPS.backGround = RED;
		lblGPS.setMenu(mnuContextFormt);
		lblGPS.modifyAll(ControlConstants.WantHoldDown, 0);
		CoordsP.addLast(lblPosition = new mLabel(myNavigation.gpsPos.toString(currFormat)),CellConstants.HSTRETCH, (CellConstants.HFILL|CellConstants.WEST));
		lblPosition.setMenu(mnuContextFormt);
		lblPosition.modifyAll(ControlConstants.WantHoldDown, 0);
		CoordsP.addNext(lblDST = new mLabel(MyLocale.getMsg(1500,"DST:")),CellConstants.DONTSTRETCH, (CellConstants.DONTFILL|CellConstants.WEST));
		lblDST.backGround = new Color(0,0,255);
		lblDST.setMenu(mnuContextFormt);
		lblDST.modifyAll(ControlConstants.WantHoldDown, 0);
		CoordsP.addLast(btnGoto = new mButton(getGotoBtnText()),CellConstants.HSTRETCH, (CellConstants.HFILL|CellConstants.WEST));

  • Frage 1: Wie macht man das?
  • Frage 2 (die interessantere): Wo steht, wie man das macht?

"Ewe Application Development" ist irgendwie nicht so recht vollständig...
 

Kalli

Geowizard
Ehrlich gesagt, ich hab's nie richtig kapiert, wie es wirklich funktioniert, ich habe einfach mit den Konstanten rumgespielt....

Schau mal in den Abschnitt "Laying Out Controls", da ist etwas beschrieben.
 
OP
Eliveras

Eliveras

Geocacher
So, viele Stunden harter Entwicklerarbeit liegen hinter mir.

Folgendes göttliche Codestück ist das Ergebnis:

Code:
		btnGoto = new mButton(getGotoBtnText());
		btnGoto.anchor = mButton.LEFT;
		CoordsP.addLast(btnGoto, CellConstants.HSTRETCH, (CellConstants.HFILL|CellConstants.WEST));
 

MiK

Geoguru
Damit sind beide linksbündig. Das ist schon ein Fortschritt. Bekommst Du auch beide zentriert hin?
 
OP
Eliveras

Eliveras

Geocacher
Das hätttest Du jetzt doch alleine geschafft...

Code:
		lblPosition = new mLabel(myNavigation.gpsPos.toString(currFormat));
		lblPosition.anchor = CENTER;
		CoordsP.addLast(lblPosition, CellConstants.HSTRETCH, (CellConstants.HFILL|CellConstants.WEST));
 
Oben