Skip to content

Commit a08a858

Browse files
committed
Basic blocks
1 parent 621f393 commit a08a858

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

guiComponents.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ namespace microgui {
312312
/**
313313
* Component that contains a Title + a chunk of text.
314314
*/
315+
316+
317+
//% block="Text Box" weight=50, color=#F0A500
315318
export class TextBox extends GUIComponentAbstract {
316319
private title: string;
317320
private maxCharactersPerLine: number;
@@ -391,6 +394,7 @@ namespace microgui {
391394
}
392395
}
393396

397+
//% block="Slider" weight=50, color=#F01000
394398
export class GUISlider extends TextBox {
395399
private maximum: number;
396400
private minimum: number;
@@ -519,6 +523,7 @@ namespace microgui {
519523
}
520524
}
521525

526+
//% block="Graph" weight=50, color=#44c900
522527
export class GUIGraph extends TextBox {
523528
private graphableFns: GraphableFunction[]
524529
/** Reads the graphableFns if the frameCounter is >= this sampling rate. */
@@ -842,6 +847,7 @@ namespace microgui {
842847
// }
843848

844849

850+
//% block="Text Button" weight=50, color=#007777
845851
export class TextButton {
846852
public bounds: Bounds;
847853
private shadowBounds: Bounds;
@@ -916,6 +922,7 @@ namespace microgui {
916922
}
917923

918924

925+
//% block="Text Button Collection" weight=50, color=#F077B3
919926
export class TextButtonCollection extends GUIComponentAbstract {
920927
private title: string;
921928
private textBtns: TextButton[];
@@ -1067,6 +1074,7 @@ namespace microgui {
10671074
}
10681075

10691076

1077+
//% block="Radio Button" weight=50, color=#28edB3
10701078
export class RadioButton {
10711079
public text: string;
10721080
private textColour: number;
@@ -1115,6 +1123,7 @@ namespace microgui {
11151123
}
11161124

11171125

1126+
//% block="Radio Button Collection" weight=50, color=#F6FAB4
11181127
export class RadioButtonCollection extends GUIComponentAbstract {
11191128
private title: string;
11201129
private btns: RadioButton[]
@@ -1281,6 +1290,8 @@ namespace microgui {
12811290
* Holds other components,
12821291
* One component is active at a time
12831292
*/
1293+
1294+
//% block="Component Scene" weight=50, color=#40BF24
12841295
export class GUIComponentScene extends Scene {
12851296
private components: GUIComponentAbstract[];
12861297
private currentComponentID: number;
@@ -1371,6 +1382,7 @@ namespace microgui {
13711382
}
13721383
}
13731384

1385+
//% block="Button Collection" weight=50, color=#F5F575
13741386
export class ButtonCollection extends GUIComponentAbstract {
13751387
private btns: Button[][];
13761388
private numberOfRows: number;

0 commit comments

Comments
 (0)