Size dinamically a Custom Control
Hi all,
in a dynpro I have two section:
- one with some parameters
- one with alv (using cl_gui_alv_grid).
I build the first section with a sub area and with a button to collapse and expand the sub area. All works fine.
The problem is that when I collapse the subarea I want to expand the custom control where the alv is.
I want to do something like the trx ME23N.
Any one can help me?
Bye
enzo
Hi,
I just wanna know how you did the collapse / expand for a sub area like tcode me23n do ???
Any help would be appreciated !
Max
>
Enzo Porcasi wrote:
> Hi all,
> in a dynpro I have two section:
> - one with some parameters
> - one with alv (using cl_gui_alv_grid).
>
> I build the first section with a sub area and with a button to collapse and expand the sub area. All works fine.
> The problem is that when I collapse the subarea I want to expand the custom control where the alv is.
>
> I want to do something like the trx ME23N.
> Any one can help me?
>
> Bye
> enzo
Similar Messages
-
Hello experts,
I built a program with just 1 screen. This screen consists of 2 sections. Section 1 contains input fields for a selection, section 2 constains a custom control on which the selected data is displayed as pdf. For the creation of the pdf I use smartforms.
First selection works fine.
If I do a second selection with other selection values the pdf is not updated but displays the values of the first selection. How can I display the new values?
IF custom_container IS INITIAL.
CREATE OBJECT custom_container
EXPORTING container_name = 'CUSTOM_CONTROL'.
ENDIF.
CREATE OBJECT html_viewer
EXPORTING parent = custom_container.
* pdf_string_x in Tabelle konvertieren
length = XSTRLEN( pdf_string_x ).
full_lines = length DIV 1000.
last_length = length MOD 1000.
CLEAR offset.
DO full_lines TIMES.
i_data = pdf_string_x+offset(1000).
APPEND i_data TO it_data.
offset = offset + 1000.
ENDDO.
i_data = pdf_string_x+offset(last_length).
APPEND i_data TO it_data.
CALL METHOD html_viewer->load_data
EXPORTING
* URL =
type = 'text'
subtype = 'pdf'
* SIZE = pdf_fsize
* ENCODING =
* CHARSET =
* LANGUAGE =
IMPORTING
assigned_url = url
CHANGING
data_table = it_data[]
* EXCEPTIONS
* DP_INVALID_PARAMETER = 1
* DP_ERROR_GENERAL = 2
* CNTL_ERROR = 3
* others = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD cl_gui_cfw=>flush.
CALL METHOD html_viewer->show_data
EXPORTING
url = url.
Thanks in advance!
JohannesCLEAR IT_DATA[].
DO full_lines TIMES.
i_data = pdf_string_x+offset(1000).
APPEND i_data TO it_data.
offset = offset + 1000.
ENDDO.
Use CLOSE_DOCUMENT
or DO_REFRESH method the second time -
Customized Control shape varies in Windows XP to Windows 7
Hello all
I have created few customized control icon and used in my application,for development i using windows XP ,screen resolution -1280X1024,when i use the Exe created in Windows7 system with screen resolution 1280X1024, the customized control icon resizes it shape.
i have tried by enabling and disabling the scaling and proportioning of panel objects in a VI to see the difference ,
File>>VI Properties>>Window Size>>Enable - Maintain proportions of window for different monitor resoltion & scale all objects on front panel as window resizes ,
please find the attched image for reference.kindly help me out ,if anyone have the solution to overcome this.
Attachments:
comparison 1.JPG 46 KBI don't know for sure, but your problem may be the font changes between Windows XP and Windows 7. By default, buttons have boolean text centered in the middle of the button. Even if the there is no text, the button will still resize with font sizes. To prevent this from happening, right click the button to select the properties and deselect the option to center the text. If you have disabled showing text, you will need to enable it, deselect centering, then disable text again.
This account is no longer active. Contact ShadesOfGray for current posts and information. -
TOP of PAGE using ABAP oo with single CUSTOM CONTROL
Can anybody please tell me how to handle TOP_OF_PAGE using ABAP OBJECTS with a SINGLE CUSTOM CONTROL and not with SPLIT CONTAINER(i.e. using single CL_GUI_CUSTOM_CONTAINER and single grid CL_GUI_ALV_GRID ). Is it possible if so Please help me out?
Hi Ravi,
Here is my code. i didn't handle the top_of_page event yet but created a method to handle.
REPORT ZSATEESH_ALV_CONTAINER MESSAGE-ID ZZ
LINE-SIZE 150 NO STANDARD PAGE HEADING.
PROGRAM id : ZSATEESH_ALV_CONTAINER *
Title : Sales document report *
Author : Sateesh *
Date : *
CR# : *
Dev Initiative :
Description :ALV GRID/LIST Report which displays the sales
document header data using ABAP Objects.
Modification Log
Corr. no date programmer description
TYPES Declaration
*--Type for the Header Sales data
TYPES: BEGIN OF TY_VBAK ,
INDICAT LIKE ICON-ID, " Icon
VBELN LIKE VBAK-VBELN, " Sales Document
AUDAT LIKE VBAK-AUDAT, " Document date
VBTYP LIKE VBAK-VBTYP, " SD document category
AUART LIKE VBAK-AUART, " Sales Document Type
AUGRU LIKE VBAK-AUGRU, " Order reason
NETWR LIKE VBAK-NETWR, " Net Value
WAERK LIKE VBAK-WAERK, " SD document currency
END OF TY_VBAK.
DATA Declaration
*--Tableto hold the header sales data
DATA: TB_VBAK TYPE STANDARD TABLE OF TY_VBAK.
*--Table to hold the Icons
DATA: BEGIN OF TB_ICON OCCURS 0,
ID TYPE ICON-ID, " Icon
NAME TYPE ICON-NAME, " Name of an Icon
END OF TB_ICON.
*--Declaration of ALV Grid Tables
DATA: TB_FDCAT TYPE LVC_T_FCAT, " Fieldcatalog
TB_SORT TYPE LVC_T_SORT. " Sorting
DATA: OK_CODE LIKE SY-UCOMM. " sy-ucomm
*--Reference variables for container and grid control.
DATA: CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
" Container reference
OBJ_ALV_GRID TYPE REF TO CL_GUI_ALV_GRID.
" Alv Grid reference
S T R U C T U R E S
DATA: X_FDCAT TYPE LVC_S_FCAT, " Fieldcatalog
X_LAYOUT TYPE LVC_S_LAYO, " layout
X_SORT TYPE LVC_S_SORT, " Sorting
X_VBAK TYPE TY_VBAK, " sales header stucture
X_ICON LIKE TB_ICON. " icons structure
C O N S T A N T S
*--Declaration of Constants
CONSTANTS :
C_GREEN(40) TYPE C VALUE 'ICON_GREEN_LIGHT',
C_RED(40) TYPE C VALUE 'ICON_RED_LIGHT',
C_YELLOW(40) TYPE C VALUE 'ICON_YELLOW_LIGHT',
C_X TYPE C VALUE 'X'. " Flag
SELECTION SCREEN
*--Block 1.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER: P_AUDAT LIKE VBAK-AUDAT
DEFAULT '20050101'(003). " doc date.
SELECTION-SCREEN: END OF BLOCK B1.
*--bLOCK 2.
SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETER :P_ALVDIS AS CHECKBOX. " For List/Grid
SELECTION-SCREEN : END OF BLOCK B2.
Class LC_VBAK definition
CLASS LC_VBAK DEFINITION.
PUBLIC SECTION.
METHODS: VBAK_POPULATE, " sales header population
ICON_POPULATE, " Icons population
FINAL_POPULATE, " Final ALV population
DISPLAY, " Displaying ALV
TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID
IMPORTING E_DYNDOC_ID.
ENDCLASS. "LC_VBAK DEFINITION
Class LC_VBAK IMPLEMENTATION
CLASS LC_VBAK IMPLEMENTATION.
METHOD VBAK_POPULATE.
*-- selecting from VBAK
SELECT VBELN
AUDAT
VBTYP
AUART
AUGRU
NETWR
WAERK
INTO CORRESPONDING FIELDS OF TABLE TB_VBAK
FROM VBAK
WHERE AUDAT > P_AUDAT AND
NETWR > 0.
IF SY-SUBRC <> 0.
SORT TB_VBAK BY AUART VBTYP WAERK .
ENDIF.
ENDMETHOD . "VBAK_POPULATE
METHOD ICON_POPULATE.
*--selecting from ICON table
SELECT ID
NAME
INTO TABLE TB_ICON
FROM ICON.
IF SY-SUBRC = 0.
SORT TB_ICON BY NAME .
ENDIF.
ENDMETHOD . "ICON_POPULATE
METHOD FINAL_POPULATE.
*--looping through VBAK table into the work area
LOOP AT TB_VBAK INTO X_VBAK .
IF X_VBAK-NETWR <= 10.
*--Reading the ICON table into work area comparing field NAME
READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_GREEN
BINARY SEARCH.
IF SY-SUBRC = 0.
X_VBAK-INDICAT = X_ICON-ID.
*--modifying the TB_VBAK table
MODIFY TB_VBAK FROM X_VBAK.
ENDIF.
ELSEIF X_VBAK-NETWR > 10 AND X_VBAK-NETWR < 100.
*--Reading the ICON table into work area comparing field NAME
READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_YELLOW
BINARY SEARCH.
IF SY-SUBRC = 0.
X_VBAK-INDICAT = X_ICON-ID.
*--modifying the TB_VBAK table
MODIFY TB_VBAK FROM X_VBAK.
ENDIF.
ELSEIF X_VBAK-NETWR >= 100.
*--Reading the ICON table into work area comparing field NAME
READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_RED
BINARY SEARCH.
IF SY-SUBRC = 0.
X_VBAK-INDICAT = X_ICON-ID.
*--modifying the TB_VBAK table
MODIFY TB_VBAK FROM X_VBAK.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD. "FINAL_POPULATE
METHOD top_of_page *
METHOD TOP_OF_PAGE.
PERFORM EVENT_TOP_OF_PAGE USING E_DYNDOC_ID.
ENDMETHOD. "top_of_page
METHOD DISPLAY.
*--Building fieldcatalog table
PERFORM FIELDCATLOG.
*--FOr making the Layout settings
PERFORM LAYOUT.
*--For sorting the fields
PERFORM SORTING.
*--perform for displaying the ALV
PERFORM ALV_GRID_DISPLAY.
ENDMETHOD. "DISPLAY
ENDCLASS. "LC_VBAK IMPLEMENTATION
*& Form FIELDCATLOG
Building the FIELDCATALOG
FORM FIELDCATLOG .
CLEAR: X_FDCAT,TB_FDCAT[].
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 1.
X_FDCAT-FIELDNAME = 'INDICAT'(004) .
X_FDCAT-TABNAME = 'TB_VBAK'(005).
X_FDCAT-SCRTEXT_L = 'STATUS_INDICATOR'(006).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 2.
X_FDCAT-FIELDNAME = 'VBELN'(007) .
X_FDCAT-TABNAME = 'TB_VBAK'(005).
X_FDCAT-SCRTEXT_L = 'SALES DOC'(008).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 3.
X_FDCAT-FIELDNAME = 'AUDAT'(009) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'DOC DATE'(010).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 4.
X_FDCAT-FIELDNAME = 'VBTYP'(011) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'SALES CATEGORY'(012).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 5.
X_FDCAT-FIELDNAME = 'AUART'(013) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'DOC TYPE'(014).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 6.
X_FDCAT-FIELDNAME = 'AUGRU'(015) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'REASON'(016).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 7.
X_FDCAT-FIELDNAME = 'NETWR'(017) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'NET VALUE'(018).
X_FDCAT-DO_SUM = C_X.
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 8.
X_FDCAT-FIELDNAME = 'WAERK'(019) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'UNIT'(020).
APPEND X_FDCAT TO TB_FDCAT.
ENDFORM. " FIELDCATLOG
*& Module STATUS_0007 OUTPUT
module for setting the pf status
MODULE STATUS_0007 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0007 OUTPUT
*& Module USER_COMMAND_0007 INPUT
module for handling the user commands
MODULE USER_COMMAND_0007 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0007 INPUT
*& Form LAYOUT
ALV Layout settings
FORM LAYOUT .
CLEAR X_LAYOUT.
*-- making Layout settings
X_LAYOUT-GRID_TITLE = 'Sales Header Document'(021).
X_LAYOUT-ZEBRA = C_X.
IF P_ALVDIS = C_X.
X_LAYOUT-NO_HGRIDLN = C_X.
X_LAYOUT-NO_VGRIDLN = C_X.
ENDIF.
ENDFORM. " LAYOUT
*& Form SORTING
sub routine for sorting criteria
FORM SORTING .
CLEAR X_SORT.
X_SORT-SPOS = '1'(022).
X_SORT-FIELDNAME = 'AUART'.
X_SORT-UP = C_X.
APPEND X_SORT TO TB_SORT.
CLEAR X_SORT.
X_SORT-SPOS = '2'(023).
X_SORT-FIELDNAME = 'VBTYP'.
X_SORT-UP = C_X.
APPEND X_SORT TO TB_SORT.
CLEAR X_SORT.
X_SORT-SPOS = '3'(024).
X_SORT-FIELDNAME = 'WAERK'.
X_SORT-UP = C_X.
X_SORT-SUBTOT = C_X.
APPEND X_SORT TO TB_SORT.
ENDFORM. " SORTING
*& Form CREATE_CONTAINER_OBJECT
subroutine to create object of container
FORM CREATE_CONTAINER_OBJECT .
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
CONTAINER_NAME = 'CUST_CONTROL'(025)
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " CREATE_CONTAINER_OBJECT
*& Form CREATE_ALV_GRID_OBJECT
subroutine to create object of ALV GRID
FORM CREATE_ALV_GRID_OBJECT .
CREATE OBJECT OBJ_ALV_GRID
EXPORTING
I_PARENT = CUSTOM_CONTAINER
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " CREATE_ALV_GRID_OBJECT
*& Form ALV_GRID_DISPLAY
subroutine to call method for displaying the ALV GRID
FORM ALV_GRID_DISPLAY .
CALL METHOD OBJ_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = X_LAYOUT
CHANGING
IT_OUTTAB = TB_VBAK
IT_FIELDCATALOG = TB_FDCAT
IT_SORT = TB_SORT
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL SCREEN 0007.
ENDFORM. " ALV_GRID_DISPLAY
START OF SELECTION
START-OF-SELECTION.
*--Creating a reference variable for the class LC_VBAK
DATA : OBJ1 TYPE REF TO LC_VBAK.
*--Creating a container object
PERFORM CREATE_CONTAINER_OBJECT.
*--Creating a ALV GRID control object
PERFORM CREATE_ALV_GRID_OBJECT.
*--Creating a object of class LC_VBAK
CREATE OBJECT OBJ1.
*--calling vbak population method
CALL METHOD OBJ1->VBAK_POPULATE.
*--calling icon population method
CALL METHOD OBJ1->ICON_POPULATE.
*--calling fianl table population method
CALL METHOD OBJ1->FINAL_POPULATE.
*--calling final method for display
CALL METHOD OBJ1->DISPLAY.
*& Form EVENT_TOP_OF_PAGE
text
-->P_E_DYNDOC_ID text
FORM EVENT_TOP_OF_PAGE USING P_E_DYNDOC_ID TYPE REF TO
CL_DD_DOCUMENT.
ENDFORM. " EVENT_TOP_OF_PAGE -
How a custom control is advised it gains or looses focus?
Hey, at least I have a question to ask, instead of answering them... :-)
Actually, I already asked it in another thread, in one of my answers: [onMouseClicked Event Is Failing To Fire|http://forums.sun.com/thread.jspa?threadID=5391008] but I fear it is lost in a rather lengthly message, so I ask it in its own thread, because I was to bring the attention of knowledgeable people (hello Sun people! :-D).
The question is simple: In a custom control in JavaFX 1.2, with skin and behavior, how a control is advised when it gains or looses focus?
The purpose is to let the skin to change the look of the component upon these events, like it is done for standard controls (eg. putting a border around the focused control).
If the control is clicked, you know (unless it is disabled) that it will have the focus. But I see no way to see the lost of focus, nor when we gain (or loose) it with Tab/Shift+Tab (if it has focusTraversable to true).
I looked for onFocus() and onBlur() events (or similar), but found nothing. No mixin, nothing related in javafx.scene.input.TextInput and friends, etc.
I explored the Web but since 1.2 is still new, I found not much information. Only a fragment of source code in [Re: Further location optimizations|http://markmail.org/message/gsevtlkeq45rrdun] where I see scene.getFocusOwner() but this one isn't easily usable because it is package protected (and it is not an event, anyway).
A possible solution would be to have a timer to inspect the state focused of the nodes, but it is so kludgy I didn't even tried to implement it!
I hope I just missed the information... If there is no easy/official/working way in 1.2, I hope this will be corrected for next version!That's a very good remark, handling of focus highlight shouldn't be done at control (model)'s level. I hesitated to put it in behavior, but it feels more natural in the skin, so I did as you suggested.
you'll need an interface, and JavaFX does not do thatYou have mixins. But I didn't used them here.
focused variable never is set to trueHave you included the
public override var focusTraversable = true;
line?
To support multiple skins, my control becomes:
public class StyledControl extends Control
// Data related to the control (the model)
public var count: Integer;
public override var focusTraversable = true;
init
if (skin == null) // Not defined in instance
// Define a default styler
skin = ControlStyler {}
package function Incr(): Void
if (count < 9)
count++;
}quite bare bones (I intendedly keep the model simple).
Note I still define a default skin in case user doesn't provide it: they shouldn't care about this detail unless they want to change it.
I defined an abstract default skin, implementing most variables (particularly the public ones that can be styled) and the focus change:
public abstract class DefaultControlStyler extends Skin
//-- Skinable properties
public var size: Number = 20;
public var fill: Color = Color.GRAY;
public var textFill: Color = Color.BLACK;
public var focusFill: Color = Color.BLUE;
package var mainPart: Node; // Decorations (id, focus) are kept out of layout
package var focusHighlight: Node;
package var idDisplay: Text;
package var valueDisplay: Text;
init
behavior = ControlBehavior { info: bind control.id }
node = Group
//-- Behavior: call controller for actions
onMouseReleased: function (evt: MouseEvent): Void
(behavior as ControlBehavior).HandleClick(evt);
postinit
// Once defined by the sub-class, insert into the node
insert [ mainPart, idDisplay, valueDisplay ] into (node as Group).content;
public abstract function ShowIncrement(): Void;
var hasFocus = bind control.focused on replace
if (hasFocus)
ShowFocus();
else
HideFocus();
// Default handling of focus display, can be overriden if needed
public function ShowFocus(): Void
insert focusHighlight into (node as Group).content;
public function HideFocus(): Void
delete focusHighlight from (node as Group).content;
public override function contains(localX: Number, localY: Number): Boolean
return mainPart.contains(localX, localY);
public override function intersects(localX: Number, localY: Number,
localWidth: Number, localHeight: Number): Boolean
return mainPart.intersects(localX, localY, localWidth, localHeight);
}and the concrete skins implement the mainPart, idDisplay, valueDisplay, focusHighlight nodes, override ShowIncrement with an animation, override getPrefWidth and getPrefHeight to set to mainPart size and might override ShowFocus or HideFocus (if we want it behind mainPart for example).
The behavior is:
public class ControlBehavior extends Behavior
public var info: String; // Only for debug information...
// Convenience vars, to avoid casting each time
var control = bind skin.control as StyledControl;
var csSkin = bind skin as DefaultControlStyler;
public override function callActionForEvent(evt: KeyEvent)
println("{info}{control.count}: KeyEvent: {evt}");
if (evt.char == '+')
Incr();
package function HandleClick(evt: MouseEvent): Void
control.requestFocus();
Incr();
function Incr(): Void
control.Incr();
println("{info}: Ouch! -> {control.count}");
csSkin.ShowIncrement();
}and knows only the abstract default skin (to apply feedback of user input to skin).
I use it as follow:
Stage
title: "Test Styling Controls"
scene: Scene
width: 500
height: 500
content:
HBox
translateX: 50
translateY: 100
spacing: 50
content:
StyledControl { id: "Bar" },
StyledControl { /* No id */ layoutInfo: LayoutInfo { vpos: VPos.BOTTOM } },
StyledControl { id: "Foo" },
StyledControl { id: "Gah" },
StyledControl { id: "Bu", skin: AltCtrlStyler {} },
stylesheets: "{__DIR__}../controlStyle.css"
}BTW, I tried layoutY: 50 in place of the layoutInfo definition, but the control remained at default place. Am I reading incorrectly the ref. or is this a bug? -
Hi all, I am developing ALV using OO concept in which custom container is placed on custom control, i have kept that custom control of full screen size but my requirement is to make custom control flexible dynamically while we are adjusting the size of main window.
I used Resizing option while designing the layout, but still its not properly serving my purpose. Is there any other way to work with it?There is no direct option which will resize custom control/container when resizing window. The one you already set will prevent from making it too small. You may however, set custom control large enought (i.e fullscreen) but resize container inside it by using methods SET_HEIGHT and SET_WIDTH of cl_gui_custom_container .
Regards
Marcin -
Is it worth it to make custom icons for a custom control/indicator?
I was making custom icons (well not very custom, but still at least somet ext) for controls and indicators, when I realized that the only times you see them are when you open the control, itself, ot if you hover over it in the project with context help on.
So the question is:
Is it worth it to create a custom icon for each custom control you make, if it will be seen only rarely? (The exception being a cluster, since, in the later versions of LabVIEW, you can actually represent your cluster on the BD as the icon you made for it, so it definitely IS worth it to make an icon for it.)
Thanks!
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Solved!
Go to Solution.Hooovahh wrote:
I'd like to add another time that you see the control's icon, is when it is a type def cluster, and you have it as a constant on the block diagram. Then double click the border to shrink the cluster. It will shrink to the size of the control's icon.
I also hardly ever make a control icon. Only when it is on the palette in a reuse package.
Yeah,t hat's what I meant in my original post, although you CAN represent a cluster constant on the BD as an icon - but it's just the little thing on the bottom of the typdef'd cluster because it obviously has no actual icon.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
Creating Custom Control on screen dynamically
Hi All,
Is it possible to create custom controls dynamically through ABAP code.
If not, can we change the size of custom control at run time through ABAP code.
Thanks
Satya PriyaHi,
Please ellaborate your Query...
if ur taking abt Custom Control in Reporting , Module Pool than it is possible using Events.
Affable
Arbind -
Hi, I'm a relatively experienced Labview user, but i have never created my own custom controls.
I need to make a 2 pole switch control for a front panel to indicate signal paths.
I have done some reading on the ni website about creating or modifying controls, but actually getting the controls editor to give me what i want is driving me crazy.
What i need is something like this:
(Would be nice to have a mirror version too)
I have been trying to modify the standard boolean toggle switch, but i do not really understand how edit the image parts works. i,e how are the different states handled? an image for each - if so i cant see how that works.
also i may have an editor problem, beacuse what ever i do when i copy to clipboard - edit - paste, i get an image with non-transparent background. (i have used both gimp & paint.net)
If anyone is a whiz at this and could help me out i would be most grateful.
paul
Labview 2010, TestStand 2010OK here is the low down on the custom control.
First creat a custom control in LabVIEW and add an OK button. Next you need to click on the wrench symbol on the menu bar to edit the button images.
Next you need to right click on the button and choose the option to import File at same size: Browse and fine the image that you want to import fo rthe up (false) condition.
Next if you right click the button and select the "Picture Item" you will see all of the pictures that you need to replace. They go in the order up, down up click and down click.
Select the next image and redo step two until all pictures for the button are replaced. Should go false state true state false state true state.
To test the control click on the tweesers icon and push the button.
Save the control and enjoy.
I hope this help
Tim
Johnson Controls
Holland Michigan -
Hi all,
I'm an italian PhD student working with Polytechnic of Bari.
I'd like to submit to this forum a question about LabVIEW and custom controls in form of ActiveX components.
Some introductory word about my problem will be helpful: in the past few months here at Polytechnic of Bari my colleagues and I developed some useful ActiveX controls with custom functionalities to use in LabVIEW.
For example we developed a "contraves", an
"endless knob" and a useful counter with a scale very similar to that of standard gazometers or energy counters.
However we are experimenting some difficulties with the integration of these controls in LabVIEW; the controls are correctly imported in our VIs with using the ActiveX Container but...
in the block diagram they appear as ActiveX references and we must use property nodes to access even their most useful property (value).
Please, do someone of you know if (and eventually how) is it possible to integrate more deeply the controls in the LabVIEW environment?
Do someone of you know if it exist an hypothetical "Custom Controls SDK" for LabVIEW more advanced of that integrated in LabVIEW 6.0?
Any hint would be appreciated.> Please can you specify in more detail how I can obtain the ActiveX
> refnum input automatically wired to a constant (I have observed this
> behaviour with the 3D-Graph control as you suggested). I haven't found
> any reference in the LabVIEW on-line help about the topic "merge-VI".
>
The first step is to build a VI that contains the panel and diagram
elements that you want to drop all at once. In your case, drop the
ActiveX control at a good size, and on the diagram, you can wire it to
helper VIs, property nodes, etc. The VI's icon and name are important
as that is what will show up in the palette menu representing your
control. The connector pane isn't used.
With the VI constructed, you want to add it to the palette menu. In the
Tools menu, Advanced, there is an item about half way down for
Customizing the Palette menu. You will need to build a New Palette Set
using the ring and name it whatever you like. You can now add your VI
wherever you like. Most likely you will want to right click to add a
new subMenu in the Controls palette and place it in a new .mnu file. In
the subMenu, right click to add Control. The file dialog will open
allowing you to select a control file to add to the palette. By
changing the filter from .ctl to all, you can insert VIs into the
controls palette.
All VIs inserted into the Control palette will act as merge VIs, meaning
that when dragged to a panel, the panel elements will be merged into the
destination panel, and the diagram elements will be merged into the
destination diagram.
For others that want to have these on the Functions palette rather than
the Controls, you add the VI to the Functions palette, then popup on the
palette item and check the menu item to make it a Merge VI.
When it comes time to distribute, you will want to give out your .mnu
file and the VI of course. Easiest is to place both of them in
user.lib. If you want the items to go at the top level of the palettes,
then you can add them to add-ons inside of vi.lib, but this causes more
upgrade challenges.
Hope that helps.
Greg McKaskle -
Hello,
Does anyone know how to increase the size of the digital display increment arrows on a slider control? I want to make the arrows bigger but the "custom control" selection under edit is grayed out. I am working with a 30" monitor and would like them to be twice the size.
Thanks,
JohnHi there John,
the procedure seems to be a bit tricky, but you can customize the increment arrows by first switching to the customize mode, then selecting the digital display and only after that it lets you select the Customize control -option. Try it. This works at least in LabVIEW 2009 and 2011.
Cheers,
Cerati -
Auto resize (dynpro / custom control / html_viewer)
Hello!
I'm using a dynpro + custom control + html_viewer.
Is there a way to make the html_viewer size dynamic? So that if resize the SAP Window the size of the html_viewer changes to the avaliable space on the screen. I don't want fullscree because i want to see the SAP standard menu.Please refer Flexible custom control
Regards
Marcin -
I need create a custom control for visualization HTML
Hi guys,
I need create a custom control for HTML files visualization on SAPGUI JAVA. I created a sample program and perfectly run on SAPGUI Windows.
Thanks.
Regards.
Jose Antonio Campos.Hi,
Just as a quick start
http://gumbo.flashhub.net/sizer/ (view source enabled).
this uses a skin to make a titlewindow resizable, its not about the skin as much as giving you a starting point for resizing code.
if you look into the skin you will see these functions
protected function sizer_mouseDownHandler(event:MouseEvent):void
OldX=event.stageX;
OldY=event.stageY;
systemManager.addEventListener(MouseEvent.MOUSE_MOVE,startResize);
systemManager.addEventListener(MouseEvent.MOUSE_UP,endResize);
protected function endResize(event:MouseEvent):void
systemManager.removeEventListener(MouseEvent.MOUSE_MOVE,startResize);
systemManager.removeEventListener(MouseEvent.MOUSE_UP,endResize);
private function startResize(event:MouseEvent): void
hostComponent.width -= OldX-event.stageX;
hostComponent.height -= OldY-event.stageY;
OldX=event.stageX;
OldY=event.stageY;
The idea is to have a hit area on your custom component (a corner, or all corners). You capture the mouseposition when you mousedown then in the mouse move eventlistener you update the object size with the difference between current X and Y from initial X and Y.
Hope this gets you started.
David -
Custom Control Help: Draw a line and output start and end points
I'm looking to find or make a custom control (or simple subVI) that will appear as a 100x100 unit grid and allow me to draw a line from one point to another on that grid. It will then output the (x,y) of the starting and end point of that line on the grid. Any help or ideas?
Thanks,
Steve
LabVIEW 2009 SP1
Solved!
Go to Solution.What you basically want is a loop with an event structure where you process Mouse Down, Move and Up events for your controls. There are any number of ways of implementing something like this, but this one will probably be the simplest:
Use a multicolumn listbox or a table for your grid. Hide the scrollbars and headers.
You can use the ActiveCell property with -2,-2 to select all cells. You can then use the cell size property to set the exact size of the cell.
Next, you put a picture control on top of the table and color its background transparent so that the table shows through. You use property node to make sure the two are aligned to exactly the same spot and size.
You use the mouse events on the picture control to detect the clicks and moves.
You use the table's Point to Row Column method to translate the event's position data to a cell.
You use the picture control VIs to draw the line on the picture based on that data.
You can even color the selected cells in the table using the table properties.
If you want to simplify things somewhat, you can also use the timeout event instead of the Mouse Move event to draw the line, but then you'll need to keep the timeout value in a shift register and reset it to -1 (no timeout) when the Mouse Up event happens.
I would also suggest processing Mouse Enter and Leave events to change the cursor and cancel if the user leaves in the middle of dragging.
Try to take over the world! -
What tool do I use to make Custom Controls and vi's from scratch
Ciphertech wrote:
What tool do I use to make Custom Controls and vi's from scratch
The sticky point is "from scratch". This is not fully possible!
Using the control editor, you always start with an existing control, which you then modify by changing cosmetic properties such as size, arrangement, color, decals, etc. You cannot start from scratch, but you can typically come close to your ideas by starting with an existing control that has all the features you want.
More here: Creating Custom Controls, Indicators, and Type Definitions
For even more complex tasks, you can make an XControl. This is basically a control that can consist of as many controls and indicators as you like, can have any datatype, and contains complex code and logic.
More here: Using XControls (There is even a tutorial)
Good luck!
Message Edited by altenbach on 09-07-2008 10:15 AM
LabVIEW Champion . Do more with less code and in less time .
Maybe you are looking for
-
TS3899 Issue: I can't get Send to work on my Telus Email account
I have setup my Telus Email account and it receives mail but will not send mail. I have reinstalled three times and same problem. The account type is IMAP/SMTP.
-
Idoc Receiver - Header Data does not update
Hi there I have an Idoc receiver in a scenario where I send a Idoc from a file to the R/3 system. My config is all fine but the Idoc status in we19 shows red. My Header data for the idoc is incorrect. The idoc is WALREQ01. In my Message Mapping Im se
-
Import Procure,ent with CIN
Hi All, I am having an issue with Import Procurement with CIN, please help me in this regard. During imports, we incorporate customs duties, freight clearing charges, CHA charges. For these we create customs office, freight forwarder etc as vendors,
-
Wait for unread message on broadcast channel during import
Hi All, I am trying to import a dump file on Oracle DB, Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi. My import hangs, below is the log. Import: Release 10.2.0.3.0 - 64bit Production on Tuesday, 03 April, 2012 21:09:20 Copyright (
-
OO-Alv Container Edit Columns ?
I am using salv container and i wanna activeted edit mode for some columns . How Can i do this ? Thanks..