javauis/lcdui_qt/src/javax/microedition/lcdui/CanvasKeypad.java
changeset 78 71ad690e91f5
parent 57 59b3b4473dc8
equal deleted inserted replaced
72:1f0034e370aa 78:71ad690e91f5
   341 
   341 
   342         // Set the game key style sheets
   342         // Set the game key style sheets
   343         cssEngine.applyCSS(gameA, "QPushButton" + "{" + "background-color:white;"
   343         cssEngine.applyCSS(gameA, "QPushButton" + "{" + "background-color:white;"
   344             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
   344             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
   345             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
   345             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
   346             + "image: url(" + RESOURCE_PATH + "qtg_mono_game_a.svg);" + "}"
   346             + "}"
   347             + "QPushButton:pressed { image: url(" + RESOURCE_PATH + "qtg_mono_game_a.svg);"
   347             + "QPushButton:pressed { border-style: inset;" + "}");
   348             + " border-style: inset;" + "}");
       
   349         cssEngine.applyCSS(gameB, "QPushButton" + "{" + "background-color:white;"
   348         cssEngine.applyCSS(gameB, "QPushButton" + "{" + "background-color:white;"
   350             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
   349             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
   351             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
   350             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
   352             + "image: url(" + RESOURCE_PATH + "qtg_mono_game_b.svg);" + "}"
   351             + "}"
   353             + "QPushButton:pressed { image: url(" + RESOURCE_PATH + "qtg_mono_game_b.svg);"
   352             + "QPushButton:pressed { border-style: inset;" + "}");
   354             + " border-style: inset;" + "}");
       
   355         cssEngine.applyCSS(gameC, "QPushButton" + "{" + "background-color:white;"
   353         cssEngine.applyCSS(gameC, "QPushButton" + "{" + "background-color:white;"
   356             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
   354             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
   357             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
   355             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
   358             + "image: url(" + RESOURCE_PATH + "qtg_mono_game_c.svg);" + "}"
   356             + "}"
   359             + "QPushButton:pressed { image: url(" + RESOURCE_PATH + "qtg_mono_game_c.svg);"
   357             + "QPushButton:pressed { border-style: inset;" + "}");
   360             + " border-style: inset;" + "}");
       
   361         cssEngine.applyCSS(gameD, "QPushButton" + "{" + "background-color:white;"
   358         cssEngine.applyCSS(gameD, "QPushButton" + "{" + "background-color:white;"
   362             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
   359             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
   363             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
   360             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
   364             + "image: url(" + RESOURCE_PATH + "qtg_mono_game_d.svg);" + "}"
   361             + "}"
   365             + "QPushButton:pressed { image: url(" + RESOURCE_PATH + "qtg_mono_game_d.svg);"
   362             + "QPushButton:pressed { border-style: inset;" + "}");
   366             + " border-style: inset;" + "}");
   363             
       
   364         gameA.setText("A");
       
   365 		    gameB.setText("B");
       
   366 		    gameC.setText("C");
       
   367 		    gameD.setText("D");
   367 
   368 
   368         // layout the game Keys
   369         // layout the game Keys
   369         FormData gameAFormData = new FormData();
   370         FormData gameAFormData = new FormData();
   370         gameAFormData.bottom = new FormAttachment(100, 0);
   371         gameAFormData.bottom = new FormAttachment(100, 0);
   371         gameAFormData.left = new FormAttachment(0, 0);
   372         gameAFormData.left = new FormAttachment(0, 0);
   439 
   440 
   440                 // Set the style sheet
   441                 // Set the style sheet
   441                 cssEngine.applyCSS(skright, "QPushButton" + "{" + "background-color:white;"
   442                 cssEngine.applyCSS(skright, "QPushButton" + "{" + "background-color:white;"
   442                     + "border-style: outset;" + "border-width: 1px; "
   443                     + "border-style: outset;" + "border-width: 1px; "
   443                     + "border-bottom-left-radius: 22px;" + "border-color: black;"
   444                     + "border-bottom-left-radius: 22px;" + "border-color: black;"
   444                     + "font: bold 14px;" + "min-width: 3em;" + "min-height: 2em;" + "image: url("
   445                     + "font: bold 14px;" + "min-width: 3em;" + "min-height: 2em;" + "}"
   445                     + RESOURCE_PATH + "qtg_mono_rsk_horizontal.svg);" + "}"
   446                     + "QPushButton:pressed { border-style: inset;" + "}");
   446                     + "QPushButton:pressed { image: url(" + RESOURCE_PATH
       
   447                     + "qtg_mono_rsk_horizontal.svg);" + " border-style: inset;" + "}");
       
   448 
   447 
   449                 cssEngine.applyCSS(skleft, "QPushButton" + "{" + "background-color:white;"
   448                 cssEngine.applyCSS(skleft, "QPushButton" + "{" + "background-color:white;"
   450                     + "border-style: outset;" + "border-width: 1px; "
   449                     + "border-style: outset;" + "border-width: 1px; "
   451                     + "border-bottom-right-radius: 22px;" + "border-color: black;"
   450                     + "border-bottom-right-radius: 22px;" + "border-color: black;"
   452                     + "font: bold 14px;" + "min-width: 3em;" + "min-height: 2em;" + "image: url("
   451                     + "font: bold 14px;" + "min-width: 3em;" + "min-height: 2em;" + "}"
   453                     + RESOURCE_PATH + "qtg_mono_lsk_horizontal.svg);" + "}"
   452                     + "QPushButton:pressed { border-style: inset;" + "}");
   454                     + "QPushButton:pressed { image: url(" + RESOURCE_PATH
   453                     
   455                     + "qtg_mono_lsk_horizontal.svg);" + " border-style: inset;" + "}");
   454                 skleft.setText("LSK");
       
   455                 skright.setText("RSK");
   456 
   456 
   457                 FormData sklFormData = new FormData();
   457                 FormData sklFormData = new FormData();
   458                 sklFormData.top = new FormAttachment(0, 0);
   458                 sklFormData.top = new FormAttachment(0, 0);
   459                 sklFormData.left = new FormAttachment(0, 0);
   459                 sklFormData.left = new FormAttachment(0, 0);
   460                 skleft.setLayoutData(sklFormData);
   460                 skleft.setLayoutData(sklFormData);