Help on custom caret painting
Hello all!
I am developing a very custom editor (not only characters, but also drawings, etc) --
therefore need a caret blinking somewhere text exists.
Tried out the following code:
* Paints only caret.
* @param pGraphics
* @param pLineHeight
private void paintCaret(Graphics pGraphics, int pLineHeight) {
final int x = getCaretX();
final int y = getCaretY();
if (x < 0 || y < 0) return;
pGraphics.setXORMode(Color.BLACK);
pGraphics.setColor(Color.WHITE);
pGraphics.fillRect(x, y, CARET_WIDTH, pLineHeight);
// caretOn =! caretOn;
}Cursor blinking is done this way:
caretBlinkTimer.schedule(new SwingTimerTask() {
protected void doRun() {
final int x = getCaretX();
final int y = getCaretY();
if (x < 0 || y < 0) return;
repaint(x, y, CARET_WIDTH, lineHeight);
}, 0/*start_jetzt!*/, CARET_BLINK_RATE);The paintComponent(Graphics) code knows if to paint caret only, or more -- to save machine resources, deducing it from area of "dirty" clip rectangle to be repainted.
Well, what's the problem?
The problem exists. The editor backgound is somehow yellow color. When application starts and editor is shown up, I can observe the default gray color instead yellow in place of hidden-by-blinking timer caret. In the same situation, if I select another component (out of this editor), which currently paints itself using a kind of turqoise, the caret turns itself in turqoise, and hidden caret even worse, in a kind of violet (I suppose is inverse of turqoise).
I tried a lot of "dances with flute" around problem, but it doesn't help at all... You see, Graphics has color settings only by setColor(Color) and setXORMode(Color). And, what more (I know 4 sure) the pGraphics object is a brand new one, each another time the "paintComponent(Graphics)" is invoked...
So, please, any ideas are accepted. Helping me, you help a lot of people with similar problems.
Thank you in advance.
What an ungodly amount of the code for the task!
I tried
SELECT * FROM SCCM_GetNextServiceWindow('00811A9E08221600', 4)
Which is said mean "Occurs the Third Monday of every 1 month(s)" and it returned 2015-03-17. Which is a Tuesday. But it is the third Tuesday.
Turns out that I have British settings on that instance, DATEFIRST is 1. If do SET DATEFIRST 7, I get 2015-03-23. Which is a Monday, but the wrong one.
The current setting of DATEFIRST can be detected with @@DATEFIRST, and that would make the code even more complex.
My gut reaction would be to start over and do it all in C#, where at least I don't have to bother about SET DATEFIRST.
Or maybe first inspect that the ScheduleToken is correct. Maybe it is, but to me that is just an incomprehensible hex string.
Erland Sommarskog, SQL Server MVP, [email protected]
Similar Messages
-
How to add search help to custom infotype listbox??
Hi All,
How to add search help to custom infotype listbox??
Thanks in advanceHi Vinay,
We have search help and list box as 2 different options.
At a time we can make a field a list box or a search help.List box is restricted and we can pick values from the defined list whereas in search help we can allow more entries and then validate the value entered later.
Implementing a listbox or search help in infotype is same as that of implementing it in a modulepool .
for search help..we can create a custom search help or check for existing search help in se11
then in the screen on infotype field..assign the search help direcly at the screen painter level..
double click on the field in screen painter -> change mode and then in the space for "search help" enter the search helps name
for list box..in the screen painter ,make sure the field is selected as list box..then in PAI of screen we do a
(Process on value-request..field fieldname module module name)..check syntax and other details...
Using function module vrm_set_value fill the field and populate it as required
Pls check and revert
Regards
Byju -
Hi all, still new at swing and customizing their look and have a few questions regarding customizing the painting of a JFileChooser. First I would like to change the gradients of the buttons. Is this possible? Usually I have gone about changing a components paintComponent method(as below). But I have no idea how to do this when trying to set the painting of a child component. Probably possible to loop also through the child components and find the buttons, but then what?
Second I had used a recursive method to set child jpanel components of a JOptionPane to set them opaque and allow the JOptionPanes new custom paint to show through. I tried to apply that to the JFileChooser and am left with an area at the bottom and left that are the default colors.
I have added statement to also change any JComponent to setOpaque(false), but this doesnt help. Any suggestions or help would be appreciated.
heres the sample and thanks again.
package filechoosertest;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.RenderingHints;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class TestFileChooser extends JFileChooser{
private Color startColor1 = new Color(255,255,255);
private Color endColor1 = new Color(207,212,206);
public static void main(String[] args) {
// TODO code application logic here
SwingUtilities.invokeLater(new Runnable(){
public void run() {
TestFileChooser tfc = new TestFileChooser();
tfc.showOpenDialog(null);
public TestFileChooser(){
super();
mySetOpaque(this);
protected void mySetOpaque(JComponent jcomp) {
Component[] comps = jcomp.getComponents();
for (Component c : comps) {
System.err.println("Component class " + c.getClass().getName());
if (c instanceof JPanel) {
System.err.println("Setting opaque");
((JPanel) c).setOpaque(false);
mySetOpaque((JComponent) c);
public void paintComponent(Graphics g) {
Dimension dim = getSize();
Graphics2D g2 = (Graphics2D) g;
Insets inset = getInsets();
int vWidth = dim.width - (inset.left + inset.right);
int vHeight = dim.height - (inset.top + inset.bottom);
paintGradient(g2, inset.left,
inset.top, vWidth, vHeight, dim.height);
private void paintGradient(Graphics2D g2d, int x, int y,
int w, int h, int height) {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
GradientPaint GP = new GradientPaint(0, h * 3 / 4, startColor1, 0, h, endColor1, false);
g2d.setPaint(GP);
g2d.setPaint(GP);
g2d.fillRect(1, 1, w, h);
}Your problem, I think, is that you are not setting the opaque on JPanels nested within other JPanels. a small recursive routine should fix this:
public MyOptionPane(Object message, int messageType, int optionType,
Icon icon, Object[] options, Object initialValue) {
super(message, messageType, optionType, icon, options, initialValue);
mySetOpaque(this);
private void mySetOpaque(JComponent jcomp)
Component[] comps = jcomp.getComponents();
for (Component c : comps) {
if (c instanceof JPanel) {
((JPanel)c).setOpaque(false);
mySetOpaque((JPanel)c);
} -
Reg : F4 help for custom fields in ALV report
hi friends..
in my internal table i have fields including 1 custom field..
DATA : BEGIN OF i_final OCCURS 0,
pernr LIKE p0000-pernr,
begda LIKE p0000-begda,
plans LIKE ZPOSITION-plans, (custom)
werks LIKE pspar-werks,
end of i_final.
i want to display this i_final table in alv. for that i genetrate one fieldcatalog
PERFORM fcat USING:
'I_FINAL' 'PERNR' 'P0000' 'PERNR' '15' 'X' '',
'I_FINAL' 'BEGDA' 'P0000' 'BEGDA' '10' 'X' '',
'I_FINAL' 'PLANS' 'ZPOSITION' 'PLANS' '8' 'X' '',
'I_FINAL' 'WERKS' 'PSPAR' 'WERKS' '14' 'X' ''.
in custom table zposition, i maintain serch help for custom field "PLANS".
then i used reuse_alv_grid_display.. for all the std fields along wit custom fields
i got f4 all std fields but for my custom i am not getting the f4 help
how can i get the F$ help for this custom fields Zposition-plans..
plz give some ideaHi
In that Ztable against the field
PLANS give the check table name as <b>T528B</b>
then it will automatically give the search help
or you can create your own search help(elementary) and add to that field
Reward if useful
regards
Anji -
How to assign search help for custom cost centre field in SRM 7.0
Hi Experts!!
We are currently working in SRM 7.0.As per our business requirement, in account assignment tab we need to use a custom
cost centre field (ZCOST_CENTRE) instead of standard cost centre field.It is observed that for standard cost centre field there is a standard web-dynpro search-help assigned where it will return the F4 search help values from backend.
Can any one of you please help me how can I assign the search-help for the custom cost centre field. Is there any FM to call the backend cost centre search help for custom field or any other way how can I achieve this?
Thanks in advance.
Regards,
Kalyanikalyani,
i can see your requirement in below way..
as it just reads: you need to assign the standard cost center help to a z cost center field in component /SAPSRM/WDC_UI_DO_ACC.. which actually is fetched though the component /SAPSRM/WDC_UI_BACKEND_SH
so, if you see the component controller of SAPSRM/WDC_UI_DO_ACC you will see the component
USAGE_SH_F4 /SAPSRM/WDC_UI_BACKEND_SH
USAGE_SH_F4 /SAPSRM/WDC_UI_BACKEND_SH INTERFACECONTROLLER
so you can replicate the same functionality for your z field.
but can you clarify one thing.. why are you going for this z field in place of standard field ? -
Search Help for Custom field in Sourcing Cockpit
Hi SRM Experts,
I added custom field "rush order" in the Structures as per requirement. I added code in MODIFY_SCREEN function module. Search help is working for "rush order" in Process Purchase Orders (to search PO) and Check Status (Searching Shopping Cart). But it is not working in sourcing cockpit. Please guide or suggest me is there any additional settings or programming is required to have search help for custom fields in Sourcing Cockpit.
Thanks a lot in advance.
Thanks,
KoyyaHi SRM Experts,
Please let me know any suggestion on this issue.
Thanks a lot in advance.
Thanks,
Koyya -
Need F4 Help for custom container element based on partner type
Hi Friends
I am displaying customer details in custom container .In that custom container I have a field Partner number,Partner type etc etc..
I included F4 help for partner number field, In that I referenced the following field.Now its coming perfectly.
wa_cat1-f4availabl = 'X'.
wa_cat1-ref_table = 'KNA1'.
wa_cat1-ref_field = 'KUNNR'.
But as per my requirement, customer wants to get the different F4 help when the partner type eq "Contact Person".
Rest of the partner type(Ship to party, Sold to party,Reseller, End user) should show the above one.
So I dont know, where I have to change, because in the field catelod level there is no option to control particular type in the column.
Kindly help me on this.
Thanks
GowrishankarHi Jose
Thanks for your Input.I created Event Receiver than Defined and implemented a method to get F4 help for customer number and email id field.Already F4 help is available for Email ID.Now I want to Include the F4 help for partner number field, it will call the search help based on partner type.I can able to get the partner number field search help, but F4 help is not working for email id.
I am not sure some whee its over writing some values or I am not sure.If I comment partner number F4 help class, I can able to get the F4 help for email address.
Plz guide to me to fix the same.
Thanks
Gowrishankar -
Need help in customizing workflow
Hi All,
Need your help in customizing APINVAPR workflow.
Please help in clarifying below point.
How APINVAPR is mapped to invoice approval process,for PO we use document type form to map the POAPPRV workflows when we customize we will map the custom workflow XXXPOAPPRV to make our workflow work.
Similarly how will we customize APINVAPR and map the workflow, pls let me know your thoughts.
My requirement is to customize the APINVAPR workflow and increase the escalation days, during the Invoice Approval Process/Escalate Document Approval activity escalation will happen in 5 days, i need to increase it by 60 days.
If anyone have worked in similar requirement, please help.
Also while downloading getting following error
While downloading workflow APINVAPR, getting below errors
Item type APINVAPR
wferr:
- 1300: Could not load.
- 1114: Could not load from database.
- 1115: Could not load all definitions referenced by 'APINVAPR' item type.
- 1115: Could not load contents of 'APINVAPR' item type.
- 1101: Could not load item types from database. FILTER=APINVAPR
- 210: Oracle Error: ORA-01480: trailing null missing from STR bind value. SQL text: SELECT protect_level, custom_level, name, display_name, description, wf_selector, read_role, write_role, execute_role, persistence_type, to_char(persistence_days) FROM wf_item_types_vl WHERE name like :itemtype ORDER BY name
But it was fine when i downlaod POAPPRV.
Any one face similar kind of issues, please help.
Thanks
BadshaHello,
I am also getting the same error.
WFLOAD apps/apps 0 Y DOWNLOAD file_name.wft INVADJTO
Item type INVADJTOwferr:
- 1300: Could not load.
- 1114: Could not load from database.
- 1115: Could not load all definitions referenced by 'INVADJTO' item type.
- 1115: Could not load contents of 'INVADJTO' item type.
- 1101: Could not load item types from database. FILTER=INVADJTO
- 210: Oracle Error: ORA-01480: trailing null missing from STR bind value. SQ L text: SELECT protect_level, custom_level, name, display_name, description, wf_selector, read_role, write_role, execute_role, persistence_type, t o_char(persistence_days) FROM wf_item_types_vl WHERE name like :itemtype ORDE R BY name
The item type exists in system. It is a seeded one.
Can anyone help on this !!!
Thanks -
F4 help for Customizing Transport Request Field....
Hi,
I need a Function Module for F4 help for Customizing Transport Request field. I have used the below FM but I ma able to get only Customizing TR for only Login User Name only but not other Users. How to get the Customizing TR which are created by other Users(Owner is diferent from Login Owner).
PARAMETERS: p_cts TYPE e070-trkorr OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cts.
PERFORM get_cts CHANGING p_cts.
*& Form get_cts
FORM get_cts CHANGING p_cts.
TYPE-POOLS trwbo.
DATA: lv_cts TYPE trwbo_request_header.
To Get only custimzing requests
CALL FUNCTION 'TR_REQUEST_CHOICE'
EXPORTING
iv_request_types = 'W'
IMPORTING
es_request = lv_cts
EXCEPTIONS
invalid_request = 1
invalid_request_type = 2
user_not_owner = 3
no_objects_appended = 4
enqueue_error = 5
cancelled_by_user = 6
recursive_call = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
CALL FUNCTION 'POPUP_DISPLAY_MESSAGE'
EXPORTING
titel = 'Transport'
msgid = sy-msgid
msgty = sy-msgty
msgno = sy-msgno
msgv1 = sy-msgv1
msgv2 = sy-msgv2
msgv3 = sy-msgv3
msgv4 = sy-msgv4.
ENDIF.
Pass the selected TR to selection screen
IF sy-subrc = 0.
MOVE lv_cts-trkorr TO p_cts.
ENDIF.
ENDFORM. " get_cts
Regards,
Deepthi.Instead of using FM 'TR_REQUEST_CHOICE', you can have direct database select on table E070 and E071.
In E070, the field TRFUNCTION determine the customizing and workbench request.
K-> Workbench Request
W-> Customizing Request -
I need help from Customer Support. Whatever this charge is on my credit card,
He recibido un cargo de su tienda, que curiosamente he visto que se han hecho muchos cargos a diferentes personas bajo el mismo copncepto y tienda.Favor acreditarme dicho monto porque no he comprado nada con ustedes y ni tengo idea donde está Minesota.Este es mi cargo. 23/07/15323343GEEKSQUAD RENE00015826 RICHFIELD UUSRD$1,428.010.00 Y veo en Internet que otros clientes han hecho reclamos del mismo concepto. Subject Author PostedGEEKSQUAD RENE00015826Care03-09-2015 06:30 PMGEEKSQUAD RENE00015826 Unknown ChargePriscillaQ12-29-2014 10:08 PMrandom 10 dollar charge from richfield MN to my ac...ChrisBurns07-01-2015 12:50 PMUnknown Geeksquad charge on my Credit CardHardingR12-01-2014 05:57 PMGeekSquad protection terms changed without being i... Lo que me hace pensar que algo anda muy mal en ese Best Buy. Como es posible que no hayan corregido e identificado quienes están detrás de este fraude que lleva años. I need help from Customer Support. Whatever this charge is on my credit card,jesmann10-05-2014 04:52 PM
Hola scj2000-
Muchas gracias por visitar nuestro foro en búsqueda de una explicación al cargo que recién apareció en tu tarjeta de crédito.
Entiendo su preocupación, ya que cualquier cargo extraño que aparece en un estado de cuenta puede ser alarmante. En este caso, el último cargo que puede recuperar usando el correo electrónico que usaste para registrarte al foro, refleja que se renovó un antivirus Kaspersky. Esta autorización nos diste cuando realizaste la compra de tu Lenovo, desde entonces se renueva automáticamente la licencia de antivirus.
Las otras publicaciones que has leído, indican lo mismo. Un cargo que se ha hecho a la tarjeta de crédito que se presentó durante la compra con la autorización del cliente.
Lamento mucho la confusión y espero esto aclare tu duda.
Atentamente, -
Search Help for Customizing Workbench request
Hi Colleagues,
I have two elements in the WD UI viz: Workbench Transport Request and Customizing transport Request.
I have Dictionary Search Help set to SEEF_MIG_TRKORR for Workbench TR but i cannot find a search help for Customizing TR.
Also there is no search filter on the SEEF_MIG_TRKORR search help. Thus i cannot use this for both the elements.
Could you please help to determine the search help for customizing request.
Thanks and Regards,
PiyushPlease try '/SAPSLL/TRKORR_W' OR 'COMSH_DIFF_KEY_GEN_REQ'
Edited by: Ramalingam Muthian on Mar 5, 2010 10:47 AM -
Digital Publishing Suite Help | Creating custom viewer apps for the iPad and iPhone
This question was posted in response to the following article: http://helpx.adobe.com/digital-publishing-suite/help/create-custom-viewer-app-ipad.html
The Approval Status section is no longer in DPS App Builder, but this reference wasn't removed. You can submit your app to the gallery using this form:
https://adobeformscentral.com/?f=ozjJFvlBionBofBtd-wjbQ# -
Hello All,
I need some help with custom tables. I have created a custom table to maintain names and I also did table maintenance generation so that the user can maintain names in this table using SM30 transaction.
The question is, in my program on the selection screen when the user press F4 I need to display the values maintained in this custom table...
Can anyone help me with this.
Thanks
PavanIf I understood you correctly, you have a program in which one or some of the selection screen fields refer to a custom database table field(s).
You want to implement a F4 functionality.
Fill an internal table with the values you want to show.
Call the function module 'F4IF_INT_TABLE_VALUE_REQUEST' in the event AT SELECTION-SCREEN ON VALUE-REQUEST FOR MYPARAM as follows.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = MYITAB-FIELD
dynprofield = MYSELSCREENPARAM
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = my_f4_itab.
Srinivas -
Shipto search help for customer
Hi Experts,
Can anybody help on my requirement.
Requirement:
I have field KUNNR as my selection screen(select option).
Whenever user get F4 help of customer ,Customer number will always
be ship to. A drop down selection is required to search for the ship to.
For my requirement I want to create custom search help,need to assign that searchhelp to field KUNNR.
I want to pick Kunnr
parvw = 'SH' from KNVV.
Can anyone help me on logic? and how to assign it?
Thanking you...
Best Regards,
Rekha.Hi
Use below Code snippet
AT SELECTION-SCREEN ON VALUE-REQUEST FOR Kunnr-low.
PERFORM f4helpShipto.
form f4helpShipto.
TYPES : BEGIN OF ty_Kunnr,
KUNNR TYPE KNA1-KUNNR,
NAME1 TYPE KNA1-NAME1,
ORT01 TYPE KNA1-ORT01,
END OF ty_KUNNR.
DATA: it_help TYPE STANDARD TABLE OF ty_KUNNR INITIAL SIZE 0,
wa_help TYPE ty_KUNNR,
it_return TYPE STANDARD TABLE OF ddshretval WITH HEADER LINE,
wa_return LIKE LINE OF it_return.
SELECT K~KUNNR K~NAME1 K~ORT01 FROM KNA1 AS K
INNER JOIN KNVP AS P ON P~KUNNR EQ K-KUNN2
INTO TABLE it_help
WHERE K~PARVW EQ 'WE'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'KUNNR'
dynpprog = sy-repid
dynpnr = sy-dynnr
value_org = 'S'
dynprofield = 'KUNNR'
window_title = 'SHIP TO PARTY HELP'
TABLES
value_tab = it_help
return_tab = it_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
endform.
Regards:
Somendra -
Can't find the Collective Search help for Customer in VD02/VD03
Hi
I ave (I hope ) an easy question for you -
I need to extent the Collective search help for Customer in VD02/VD03 with an additional elementary search help, but I can't find the name of the Collective Search Help (F1 -> Technical Information only gives Search help '=')
So, where do I find it ?
Regards
Morten NielsenOK I Found it - Called DEBI
Regards
Morten Nielsen
Maybe you are looking for
-
I have given my 4s to my wife, she has an iCloud account which uses her work address, she has now left the company and we want to start a new iCloud account, trouble is we cannot delete the old account, we have created a new iCloud account but the iP
-
How do I remove an iCloud account without using password?
How do I remove an iCloud account without using password?
-
Error while registering user with owb repository.
Hi all, I am using owb 10gr2. I am trying to register a user with owb repository. I am getting below error. ORA-00955: name is already used by an existing object But when i try to deploy the mapping, it is showing a message Cannot deploy PL/SQL maps
-
I'd like to synchronise my phone because of a pbm with an app. But it is not recognized at all by ITunes... I uninstalled, repaired, installed ITunes, Quicktime, turned off several time the phone... and the pbm still be... Anyone knows what to do pls
-
How to close the detach popup on click of a button in the panel collection
Hi, I'm using Jdeveloper 11.1.2.3.0. I have an af table surrounded by panel collection. There is a button on panel collection to commit the changes in the table. Clicked detach button to view the table in full browser. On click of Commit button, the