Skip to content

Commit

Permalink
git pushMerge branch 'GAMA_1.8.2' of github.com:gama-platform/gama in…
Browse files Browse the repository at this point in the history
…to GAMA_1.8.2
  • Loading branch information
RoiArthurB committed Jul 1, 2021
2 parents 8f9d657 + 624bd50 commit b9f6d79
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ model BingMapImageImport
global
{
image_file static_map_request;
map
answers <- user_input_dialog("Address can be a pair lat,lon (e.g; '48.8566140,2.3522219')", [enter("Address","")]);
string center_text <- answers["Address"];
int zoom_text <- 15;
geometry shape<-square(500);
action load_map
{
map answers <- user_input_dialog("Address can be a pair lat,lon (e.g; '48.8566140,2.3522219')", [enter("Address","48.8566140,2.3522219")]);
string center_text <- answers["Address"];
string zoom <- "zoom=" + zoom_text;
string center <- "center=" + center_text;

string rest_link<- "https://dev.virtualearth.net/REST/v1/Imagery/Map/AerialWithLabels/"+center_text+"/"+zoom_text+"?mapSize="+int(world.shape.width)+","+int(world.shape.height)+"&key=AvZ5t7w-HChgI2LOFoy_UF4cf77ypi2ctGYxCgWOLGFwMGIGrsiDpCDCjliUliln";
write rest_link;
static_map_request <- image_file(rest_link);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Name: UserInputdialog_example
* Author: Patrick Taillandier
* Description: Model which shows how to use user_input_dialog
* Tags: gui
*/

model Confirmdialog_example

global {
init {
//2 types of elements can be added: enter (enter a value) and choose (choose a value among a list of possible values)
map result <- user_input_dialog("Main title",[enter("Enter a value", 0.0) , choose("Choose a value",string,"value 1", ["value 1","value 2"])]);

write sample(result);
}
}

experiment UserInputdialog_example type: gui ;
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ protected Control createDialogArea(final Composite parent) {
final var text = new Label(composite, SWT.None);
text.setBackground(IGamaColors.OK.inactive());
text.setForeground(GamaColors.getTextColorForBackground(text.getBackground()).color());
text.setFont(new Font(WorkbenchHelper.getDisplay(), font.getFontName(), font.getSize(), font.getStyle()));
if (font != null)
text.setFont(new Font(WorkbenchHelper.getDisplay(), font.getFontName(), font.getSize(), font.getStyle()));
text.setText(title);
var data = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
text.setLayoutData(data);
Expand Down

0 comments on commit b9f6d79

Please sign in to comment.