Make a JScrollBar only update its JScrollPane when the user releases it?

Hi
I have a JTable inside a JScrollpane. The JTable gets its data from my TableModel using the getValueAt method in the normal way. It is almost working fine. The one thing left to improve is that I don�t want the JTable to keep trying to get its data while the scrollbar is still being dragged. This is primarily because the latency in fetching the data makes the UI unresponsive - the table model does not keep all rows in memory at one time, but keeps a page of data in memory.
So, just to clarify, I want the behaviour to be that when the user is still adjusting the value of the scroll bar, the thumb position of the scroll bar moves, but the rows displayed in the JTable do not update. When the user releases the scrollbar, the rows should then update.
I have almost acheived this by having a second, independent scroll bar on the frame, and an adjustment listener listening for events, like this
public void adjustmentValueChanged(AdjustmentEvent e){
if (e.getSource() == scrManual){
if (!scrManual.getValueIsAdjusting()){
  JScrollBar scrTable = scrPaneResults.getVerticalScrollBar();
int iManValue = scrManual.getValue();
int iManMax = scrManual.getMaximum();
float fManWhere = (float)iManValue / (float)iManMax;
int iTblMax = scrTable.getMaximum();
int iTblNewValue = (int)(iTblMax * fManWhere);
  scrTable.setValue(iTblNewValue);
else
throw new IllegalArgumentException("I don't know how to handle the adjustment event for " + e.getSource());
}This is actually working fine, except that I don't want there to be two scrollbars - one in the scroll pane and one extra one. But when I try to make the scrollpane's scrollbar invisible, it remains visible.
Can anyone tell me either
(a) how to just have a normal JScrollPane scrollbar, but have it only update its viewport when the value is no longer adjusting (ie scrollbar has been released)
(b) how to make the JScrollPane's scrollbar still effective, but invisible.
(c) if the JScrollPane has a no scrollbars policy, how to instead in the code I posted above, set the ScrollPane's position directly.
Whichever is easiest.
Thanks for your help
Mark

Oh how embarassing! I already asked this question before, and answered it myself! Sorry - I think I am losing the plot
I�ve hacked it. Turns out that the jScrollPane has a getXXXScrollBar method, which even when you�ve hidden the scrollbars, still works. You just use another scroll bar, register a listener for the mouse released event, and update the jScrollPane�s scroll bar to match the value.

Similar Messages

  • How can flex tell if  it's a mouseup event when the user releases the mouse button outside the flex application?

    how can flex tell if it's a mouseup event when the user
    releases the mouse button outside the flex application? Say for
    instance mousedown was done within a 500x500 embedded flex app but
    mouseup is outside or relased on the HTML background. One more
    thing, when we have something draggable, Flex doesn't execute the
    stopDrag() when the user releases the mouse button outside the
    embedded swf or fles app. Pls. help me with this. Thanks!

    I don't think the flex app can tell what happens outside the
    app. But it can detect when it leaves the app, so I have found the
    following line works fine inside initApp():
    this.stage.addEventListener(Event.MOUSE_LEAVE, yourFunction);
    and you have to:
    import flash.display.Stage;
    Doug

  • When the user press the button Calculate Tax (see attached doc) and click on Tax details then this should be updated automatically. But it does not work it is empty and the user has to update manually.

    When the user press the button Calculate Tax  and click on Tax details then this should be updated automatically. But it does not work it is empty and the user has to update manually.
    All setup looks fine.
    Please let me know what can be done on this?
    Regards,
    Peu

    HarryAustralia wrote:
    I recently updated my ipad wifi only to the new ios 6.1.2 and initially I had the auto cover lock option which can be seen in the Generals tab, but then it stoped working!! Before the update, the auto cover lock worked fine. So after trying all the options, I then did a complete reset on the ipad and now its gone all together from the General tab!! I can no longer see the "auto cover lock" option.
    The iPad cover lock is for when you use a cover with magnets in it to lock and unlock the iPad when you close the cover or open it. Try running a refrigerator magnet along the sides of the iPad and see if that trips the iPad Cover Lock back into the settings.
    That is not the same thing as the iPad Auto Lock setting which allows you to set an allotted time before the iPad goes to sleep.
    You can try resetting all settings to see if the Auto Lock feature retinrs to the iPad.
    Settings>General>Reset>Reset All Settings. You will have to enter all of your device settings again.... All of the settings in the settings app will have to be re-entered. This can be a little time consuming re-entering all of the device settings again.

  • I want the system automatic update my UDFs when the OnHand was changed.

    I added two UDFs in table OITW to count the warehouse OnHand by CASES and Bottles. I want the system automatic update my UDFs when the OnHand was changed.  Is there any way I can do it in database level instead in the application (too much places involved).

    There is few ways how to do this:
    - triger as David said, but I dont recomend it through SAP policy
    - in stored procedure transaction notification  by adding or updating document update your user field
    - create job in SQL server which in specific interval recalculate the changes of onhand and update your user defined field
    - create addon which will be over functiuonalities which may change the onhand value
    I think that from SAP is possible only Addon, but the easist way is trigger and if you dont need it just in time but for example every 10 seccond, the better is job which cannot fail the standard SBO transaction (triger may and may be unsafe).
    Hope it helps
    Petr

  • HT1414 hi everyone , having trouble with restoring my iphone, i did follow the step untul extracting the update software but when the iphone start to restoring my iPhone always turn off and it say Error 21 on my PC monitor ...please help me icannot get my

    hi everyone , having trouble with restoring my iphone, i did follow the step untul extracting the update software but when the iphone start to restoring my iPhone always turn off and it say Error 21 on my PC monitor ...please help me i cannot get my iPhone turn on

    Error 20, 21, 23, 26, 28, 29, 34, 36, 37, 40
    These errors typically occur when security software interferes with the restore and update process. FollowTroubleshooting security software issues to resolve this issue. In rare cases, these errors may be a hardware issue. If the errors persist on another computer, the device may need service.

  • Microsoft Office 2011 no longer opens because "there is a problem" after updating mountain lion when the app store said there was an update available this morning. Reinstalling did not work. What's the problem?

    Microsoft Office 2011 no longer opens because "there is a problem" after updating mountain lion when the app store said there was an update available this morning. Reinstalling did not work. What's the problem?

    Has your problem been solved by the updates??
    Have a similar problem. This MacBook opened all MS Office programs in Dec2012 but no longer does in Feb2013. Went to Microsoft/mac/downloads but none of the three updates would run citing a problem "version of software needed to run this update was not found on this volume".
    MacBook: 7.1, Intel Core 2 Duo, 2.4 GHz
    Microsoft Office 2011:  version 14.2.3
    Mountain Lion: 10.8.2 (12C60)

  • Page distorted in ITS application when the password in the backend expired.

    Hello All-
    When the password in the backend is expired for a user and is the user is setup as a dialog user, when the user is trying to access ITS based applications they are getting a page which will prompt to reset password in the portal. This page is distorted, it does not show any labels and the buttons also does not contain any labels on them.
    This is a standard page. Does any body know from where this page is getting loaded from the ITS server?
    Any help is greatly appreciated.
    Thanks,
    Chakri.

    The table that I don't want to break between rows looks like this, except it fits the width of the page:
    quilt name
    picture of quilt      
    source
    Size: XX; Difficulty Level: 3
    I inserted a Inline Text box into the document, copied the table inside the text box, then pasted it through the document (which lists quilting projects).  When the table spans a page break, even when in an inline text box, the picture which is in the right hand column splits, as well as the information pertaining to the particular quilt.
    Jerry - thank you for your help.  I tried to give you a "solved my problem" rating, but I am adjusting to the Mac slowly after 20+ years on a PC.

  • How to make a text field required at run time when the user clicks the checkbox ?

    I got a form where , there are several checkboxes and text fields associated with that checkboxes.If the use clicks on the check box then the associated
    text fields should become required.I have tried the change event and the click event for the checkboxes.It gives error in the onChnage event and I got some weird results in the on click event .Sometimes if the user click the check box , then for the 1st time the field doesnt become required , then the user onclicks the check box and when the user clicks the checkbox for the second time the field becomes required,but if i deselects the highlighted field option and selects it again the field becomes required even if the user onchecks it I am totally confused !!! Adding to it i have also written the wrong code still i achieved the desired result ?? How it can be possible . I am writing the codes below , please help me as i am working under a deadline from the client.
    onChange event :
    var newVal = this.boundItem(xfa.event.newText);
    if(newVal == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "disabled";
      else
         xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1" ).validate.nullTest = "error";
    For the onClick event :
    var a = xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovere d_OnlyEnergyCharges").rawValue;
    //app.alert(a);
    if(a == 0)
        xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "error";
      if(a == 1)
          xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").validate.nullTest = "disabled";
       Please help someone !!!

    I used the onchange event and wrote the code for it. I got the result . But there is a problem.All these fields are in a table and it's a dynamic table where you can add rows dynamically at the run time .I have other change event for some fields in this table .All are working fine when i add the row.But for this check box the required fields are not validated as required at the run time . I am here giving the code , Please help me .
    form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovered_OnlyEnergyCharge s::change - (JavaScript, client)
    if(this.rawValue == "1")
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory= "error";
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory= "error";
    else
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L1_1").mandator = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_ L2_1").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L1_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row5.ComplianceCheck_ L2_2").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L1_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row6.ComplianceCheck_ L2_3").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L1_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row7.ComplianceCheck_ L2_4").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L1_5").mandatory = "disabled";
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row8.ComplianceCheck_ L2_5").mandatory = "disabled";

  • How can I make a JButton enabled when the user types smthg in a JTextField?

    Hello,
    I have a JButton and a JTextField on a frame. The JButton is disabled, myButton.setEnabled(false).
    How can I enable the button when the user types something in the text field? Just typing, not pressing enter.
    Thank you

    There isn't one, actually. What you need is a DocumentListener and you have to associate it with the document object associated with the field i.e.
    field2.getDocument().addDocumentListener() (new DocumentListener() {
    });

  • Cancel download method when the user cancel the download file

    I have a method that download a file ("downloadLog_action()")when the user click over the comandlink component and the dialog box is opening to save the file, but how to know that the user canceled the download file to cancel all accions.
    This is the code of the commandlink in the jspx page that call the method and pass one parameter:
    <af:commandLink binding="#{ConsultaValidacion.commandLink1}"
    id="commandLink1"
    action="#{ConsultaValidacion.descargarLog_action}"
    text="Log">
    <f:param name="codInstitucion"
    value="#{row.CodInstitucion}"
    binding="#{ConsultaValidacion.codInstitucion}"
    id="codInstitucion"/>
    </af:commandLink>
    This is the method to download the file:
    HttpServletResponse response = (HttpServletResponse)fctx.getExternalContext().getResponse();
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition", "attachement; filename=\"Log_" +
    codigoInstitucion + ".txt\"");
    response.setContentLength((new Long(blob.getLength())).intValue());
    //Streams de entrada y salida
    InputStream is;
    OutputStream out;
    try {
    //Obtenemos el stream de entrada el cual se lo extrae de la BD
    is = blob.getInputStream();
    //Obtenemos el stream de salida para el cliente
    out = response.getOutputStream();
    //Sección de código que me permite escribir los datos en el stream de salida
    int size = (new Long(blob.getLength())).intValue();
    byte[] buffer = new byte[size];
    int length = -1;
    while ((length = is.read(buffer)) != -1) {
    out.write(buffer, 0, length);
    //Cerramos los streams
    out.flush();
    is.close();
    out.close();
    *//Una vez descargado todo el LOG actualizamos el contador. HERE IS THE PROBLEM BECAUSE THE COUNTER IS UPDATING WHEN THE USER CANCEL THE DOWNLOAD!!! AND ITS WRONG*
    row.setNumDescargaLog(new Number(num + 1));
    //Guardamos los cambios
    webRvc.getAppModuleWebRvc().getDBTransaction().commit();
    //Request lifecyce understands that the response is completed and no further action needs to happen
    fctx.responseComplete();
    } catch (IOException e) {
    e.printStackTrace();
    webRvc.close("Consulta bitacoras validacion");
    return null;
    } catch (JboException ex) {
    webRvc.getAppModuleWebRvc().getDBTransaction().rollback();
    webRvc.close("Consulta bitacoras validacion");
    return null;
    This works fine.
    The problem occurs when the user cancels the download, because all the sentences run including updating the counter downloads, the counter only to be updated only when the user chooses to save the file.

    Hi.
    The problem is when the user cancel the dowload I do not know how to capture the user's response.
    How to capture the response?
    if(cancelled) <------Is there a parameter to tell me this?
    ......<your cancel code>..... none
    else
    .....<your non-cancel code>...THE METHOD THAT DOWNLOAD THE FILE - "downloadLog_action()" and increment the counter
    Thanks.

  • How do I sign my VB / VS 2010 based shared COM add-in for Excel so it loads when the user has checked "Require application add-ins to be signed by a trusted publisher"?

    My COM add-in is developed using VS 2010 and VB. It's a shared COM add-in (not VSTO) and it works with Excel 2007 - 2013. My installer is signed with a code signing certificate but it would appear that my add-in's .dll should also be signed if the user has
    checked the "Require application add-ins to be signed by a trusted publisher" option.
    The "Sign the assembly" option is checked in my add-in's VB -> My Project -> Signing. I have a .snk file selected which I seem to recall generating 6 or 7 years ago when I ported the COM add-in from VB6 to .NET. 
    I have an up-to-date Comodo code signing certificate (a pfx file called MyCompanyCodeSigningCertificatePrivateKey.pfx) which I purchased to use with the installer and was wondering if and how I could use this.
    I tried selecting my pfx file in the My Project -> Signing -> "Choose a strong name key file" dialog. It made a copy of the pfx file in my project folder but when I tried to build the project, I got the following error:
    Error 1 Cannot import the following key file: MyCompanyCodeSigningCertificatePrivateKey.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the
    following key container name: VS_KEY_C0B6F251F0FB6016
    After a little research, I found out I might be able to use signtool to sign the dll in a post-build step.
    I added the following command to the post-build event, before the command I use to regasm the assembly.
    "path to signtool\signtool" sign /f "MyCompanyCodeSigningCertificatePrivateKey.pfx" /p "xxxx" /v "$(TargetPath)"
    When I built the project, the dll appeared to get signed (the output window showed a bunch of confirming text as well as "Successfully signed: c:\MyAddIn\bin\Release\MyAddIn.dll") but the next step in the post-build (regasm myaddin.dll /codebase)
    issued a warning RA0000 (see below) but reported "Types registered successfully".
    Here's the message I get from regasm, even though the output window says the dll was sucessfully signed:
    RegAsm : warning RA0000: Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it.
    Types registered successfully
    I'm not using a shim if that makes a difference.
    How do I sign my add-in so it loads when the user has checked "Require application add-ins to be signed by a trusted publisher"?
    Any tips would be appreciated.

    Hello,
    Why do you need to use the regasm utility from the post-build action?
    There is a difference between signing the assembly with a strong name and digital signature. The
    How to: Sign an Assembly with a Strong Name article in MSDN explains how to sign an assembly with a strong name (.snk). See
    How to digitally sign a strong named assembly for adding a digital signature.
    You may also find the
    What's the Difference, Part Five: certificate signing vs strong naming article helpful.

  • RegisterPointerInputTarget() breaks InjectTouchInput() on Windows 8.1 when the user physically touches the screen.

    This is a "working on Windows 8.0 but broken on 8.1" problem.
    My application is a full screen magnifier. When magnification is turned on, there is no longer a 1:1 relationship between touch screen coordinates and desktop coordinates.
    So I need a way to allow the user operate the computer, such as dragging or pinching something on the desktop (icon/window/whatever). So when they drag their finger(s) across the touch screen, I need to capture that, translate the touch coordinates from magnified
    pixels coordinates into original desktop pixels and then inject new input to the app. I also want the ability to capture the touch input and not pass it to the app (so I can have gestures/whatever to control the magnifier viewport location). I might also want
    to inject input when the user is not touching the real screen.
    So I am capturing all touch input RegisterPointerInputTarget() and simulating touch input using InjectTouchInput() (after translating coordinates from the screen to the magnified desktop).
    My code for simulating touch input works fine in isolation (as does the SDK sample). My code for capturing all touch input also works fine. However, if they are both used at the same time it’s not happy, although I am not getting any error codes back from the
    API.
    Specifically, attempts to simulate a touch and hold or a touch and drag are not working whenever the user is physically touching the real touch screen. Further diagnosis indicates that the touch input messages are not arriving in the target application. The
    moment the user physcially touches the screen, any simulated input in progress gets cancelled and all subsequent calls to InjecttouchInput() are ignored - but no error code is returned.
    Because I am capturing all real input using RegisterPointerInputTarget(), I would expect all real physical input to be redirected to my window (which it does) and be able to call InjectTouchInput() at any point to simulate input. The simulated input would go
    to the target app and not be captured by my own process.
    This all worked fine in Windows 8.0 but is broken in  windows 8.1.
    I have written a basic test application that does two things.
    1.       Uses RegisterPointerInputTarget() to consume all touch input.
    2.       Uses InjectTouchInput() to simulate some output. In this case, it just does a click, followed by a down, a drag and an up – which handily draws a line in the paint application if you arrange your windows carefully.
    If I run this, it works until you physically touch the screen with your finger. The moment you do this, InjectTouchInput stops working (no error code), but the paint app receives a mouse up and the line stops. The hwnd to capture all touch input does receive
    WM_POINTER... messages and I an returning 0 from this function (have tried other return codes, nothing makes any difference).
    So it looks like that if you use RegisterPointerInputTarget(), any physical input is captured, but it also breaks any simulated touch gestures that are currently in progress.
    Source code is below, which you can drop in as a replacement for the main .cpp file in your injecttouch sample code from the win8 sdk (and set uiaccess=true and code sign it!). It does it in two threads, however this doesn’t seem to matter, it does the same
    thing with one thread. Am I doing something wrong?  (and yes, I know that calling Sleep() is not wise - my real app doesn't do this)?
    - Mike.
    // allow use of Windows 8 headers
    #undef WINVER
    #define WINVER 0x0602
    #include "stdafx.h"
    #include <debugoutx.h>
    #include <process.h>
    * WinMain *
    * Application entrypoint *
    static HWND touch_hwnd = NULL;
    static ATOM touch_window_atom = NULL;
    LRESULT CALLBACK TouchThread_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
    switch (message)
    case WM_CLOSE:
    DestroyWindow(hWnd);
    touch_hwnd = NULL;
    break;
    case WM_NCPOINTERUPDATE :
    case WM_NCPOINTERDOWN :
    case WM_NCPOINTERUP :
    case WM_POINTERENTER :
    case WM_POINTERLEAVE :
    case WM_POINTERACTIVATE :
    case WM_POINTERCAPTURECHANGED :
    case WM_TOUCHHITTESTING :
    case WM_POINTERWHEEL :
    case WM_POINTERHWHEEL :
    // case DM_POINTERHITTEST :
    case 0x250:
    case WM_POINTERUPDATE :
    case WM_POINTERDOWN :
    case WM_POINTERUP :
    // consume pointer mesages
    dprintf(L"msg %x\n",message);
    return 0;
    break;
    case WM_TIMER:
    break;
    default:
    dprintf(L"msg %x\n",message);
    return DefWindowProc(hWnd, message, wParam, lParam);
    break;
    return 0;
    void Inject(POINTER_TOUCH_INFO &contact)
    Sleep(1);
    while(1)
    DWORD bRet = InjectTouchInput(1, &contact);
    if (bRet==0)
    DWORD temp = GetLastError();
    if (temp==ERROR_NOT_READY)
    Sleep(1);
    continue;
    else
    DebugBreak();
    break;
    static int start = 400;
    static int end = 800;
    bool SimulateInput(POINTER_TOUCH_INFO &contact)
    static int x = start;
    if (x==start)
    contact.pointerInfo.ptPixelLocation.x = x;
    // inject a touch down
    contact.pointerInfo.pointerFlags = POINTER_FLAG_DOWN | POINTER_FLAG_INRANGE | POINTER_FLAG_INCONTACT;
    Inject(contact);
    else if (x==(start+1))
    Sleep(10);
    contact.pointerInfo.pointerFlags = POINTER_FLAG_UP ;
    Inject(contact);
    else if (x==(start+2))
    contact.pointerInfo.pointerFlags = POINTER_FLAG_DOWN | POINTER_FLAG_INRANGE | POINTER_FLAG_INCONTACT;
    Inject(contact);
    else if (x==end)
    contact.pointerInfo.pointerFlags = POINTER_FLAG_UP ;
    Inject(contact);
    PostMessage(touch_hwnd,WM_QUIT,0,0);
    return false;
    else if (x<end)
    // drag
    contact.pointerInfo.ptPixelLocation.x = x;
    // contact.rcContact.left = x - 4;
    // contact.rcContact.right = x + 4;
    contact.pointerInfo.pointerFlags = POINTER_FLAG_UPDATE | POINTER_FLAG_INRANGE | POINTER_FLAG_INCONTACT;;
    Inject(contact);
    x++;
    return true;
    void thread2(void *)
    // create window to capture global touch input.
    if (!touch_window_atom)
    WNDCLASS wc;
    wc.style = 0; // Class style(s).
    wc.lpfnWndProc = TouchThread_WndProc; // Function to retrieve messages
    wc.cbClsExtra = 0; // No per-class extra data.
    wc.cbWndExtra = 0; // No per-window extra data.
    wc.hInstance = GetModuleHandle(0); // Application that owns the class.
    wc.hIcon = NULL;
    wc.hCursor = NULL;
    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wc.lpszMenuName = NULL; // Name of menu resource in .RC file.
    wc.lpszClassName = L"MarsTouchInputCapture"; // Name used in call to CreateWindow.
    // Register the window class and return success/failure code.
    touch_window_atom = RegisterClass(&wc);
    touch_hwnd = CreateWindowEx(WS_EX_NOACTIVATE,L"MarsTouchInputCapture",L"Magnification",0,0,0,1,1,NULL,NULL,GetModuleHandle(0),NULL);
    // capture global desktop touch input
    if (RegisterPointerInputTarget(touch_hwnd,PT_TOUCH)==0)
    DWORD err = GetLastError();
    MessageBox(NULL,L"RegisterPointerInputTarget(PT_TOUCH) failed",L"error",MB_OK);
    if (RegisterPointerInputTarget(touch_hwnd,PT_PEN)==0)
    DWORD err = GetLastError();
    MessageBox(NULL,L"RegisterPointerInputTarget(PT_PEN) failed",L"error",MB_OK);
    // message loop
    MSG msg;
    while (GetMessage(&msg, NULL, 0, 0))
    DispatchMessage(&msg);
    UnregisterPointerInputTarget(touch_hwnd,PT_TOUCH);
    UnregisterPointerInputTarget(touch_hwnd,PT_PEN);
    int
    WINAPI WinMain(
    _In_ HINSTANCE hInstance,
    _In_opt_ HINSTANCE hPrevInstance,
    _In_ LPSTR lpCmdLine,
    _In_ int nShowCmd)
    POINTER_TOUCH_INFO contact;
    BOOL bRet = TRUE;
    MessageBox(NULL,L"Break on Load",L"Attach Debugger",MB_OK);
    // assume a maximum of 10 contacts and turn touch feedback off
    InitializeTouchInjection(10, TOUCH_FEEDBACK_NONE);
    // initialize the touch info structure
    memset(&contact, 0, sizeof(POINTER_TOUCH_INFO));
    contact.pointerInfo.pointerType = PT_TOUCH; //we're sending touch input
    contact.pointerInfo.pointerId = 7; //contact 0
    contact.pointerInfo.ptPixelLocation.x = 400;
    contact.pointerInfo.ptPixelLocation.y = 480;
    contact.touchFlags = TOUCH_FLAG_NONE;
    contact.touchMask = TOUCH_MASK_ORIENTATION | TOUCH_MASK_PRESSURE;
    contact.touchMask = 0;
    contact.orientation = 90;
    contact.pressure = 32000;
    // create thread/window for global capture
    _beginthread(thread2,0,NULL);
    while(SimulateInput(contact))
    Sleep(1);
    return 0;

    I have almost same situation. But there are some different. I am using RegisterPointerInputTarget to redirect all touch message to my window. and use InjectTouchInput to simulate each flag, which means, WM_POINTERDOWN,WM_POINTERUPDATE,WM_POINTERUP. If user
    touches monitor, I simulate DOWN, if user swipes their finger, I simulate UPDATE, if user lifts finger, I simulate UP.
    Then the interesting point is, system consider user's finger as primary pointer, and my injected touch as secondary pointer. windows desktop and windows explorer skip all my injected touch. I really hate that.
    However IE and chrome will accept my injected touch, they don't caret about primary pointer.
    In order to fix this problem, I call AccNotifyTouchInteraction before calling InjectTouchInput.
    According to the MSDN, AccNotifyTouchInteraction will notify the destination window before InjectTouchInput. But this idea still fails, which is disappointing.

  • Error in sql server with a trigger (I want to display a customize message, when the user left a blank field or null) How can I do?

    How I display a customize message(with a trigger)when a user left a blank field? I want to the stop the insert statament if the user left  the status field in blank. I create a trigger but now I can't enter a row, i used an instead trigger
    too but doesn't work. I want to display a customize message when the user left the
    status field in blank or null. 
     I have the following code:
    CREATE TRIGGER [dbo].[BLANKFIELD] 
    ON [dbo].[Status] 
    FOR INSERT 
    AS 
    BEGIN 
    IF (SELECT COUNT(*) FROM inserted WHERE Status IS NULL) =1
     PRINT 'Please Fill the Status  field is required'
    Rollback;
    END 

    I agree with other comments that you should do this with specifying that the column is NOT NULL to prevent it from being NULL and a constraint if you don't want it to be blank (spaces or the empty string - note that the empty string is not the same thing
    as NULL).
    But for completeness, the reason your trigger does not ever allow you to enter a row is the code
    IF (SELECT COUNT(*) FROM inserted WHERE Status IS NULL) =1
    PRINT 'Please Fill the Status field is required'
    Rollback;
    Since you don't have a begin/end block after IF, the only conditionally executed statement is the one immediately following the IF (that is the PRINT).  So the Rollback is always executed whether or not the IF is true and so all updates are rejected.
    So if you were to do this in a trigger you could do something like the following
    CREATE TRIGGER [dbo].[BLANKFIELD]
    ON [dbo].[Status]
    FOR INSERT
    AS
    BEGIN
    IF EXISTS(SELECT * FROM inserted WHERE Status IS NULL)
    BEGIN
    PRINT 'Please Fill the Status field is required';
    Rollback;
    END
    END
    (As José noted, there can be more than one row in the inserted pseudo table, so you don't want to test whether the COUNT = 1, instead just whether one or more rows exist where the Status  is null.  If you want to prevent Status is NULL, or all
    spaces, or the empty string, then your IF statement would be
    IF EXISTS(SELECT * FROM inserted WHERE ISNULL(Status, '') = '')
    Tom

  • Problems to restrict access to a page when the user belong to more than 1 group

    I have realized that Dreamweaver on a coldfusion document only works fine when the user only belongs to a single group, this is because the code supplied by dreamweave when you use the option "Restrict access to a page" at "Server behaviors" it assumes that the user only have one group as you can see on this line created automaticly by dreamweaver:
    <cfif MM_Username EQ "" OR MM_UserAuthorization EQ "" OR ListFind("admin",MM_UserAuthorization) EQ 0>
    MM_UserAutorization has the value of the field assigned for the list of groups or levels, as you can see it could work if we reverse the parameters of the listfind function but the problem would be if we grant the access to more than one group because the sentence would be like this:
    <cfif MM_Username EQ "" OR MM_UserAuthorization EQ "" OR ListFind("Admin,Manager",MM_UserAuthorization) EQ 0>
    so both paramethers are lists therefore no user will get access to the page.
    I am trying to make a work around to fix this problem but I don't know how to get the name of the page since the Application.cfc so I can validate the access to this page against tables on my database.
    Does someone have a work around or a tip how to fix this problem?
    Thanks in advance.
    AG

    Seems like you have a problem with your group names.ctxLdap.modifyAttributes(groupName,member);Ensure that the value of your variable groupName is a a valid distinguished name.
    Note that an OU (organizationalUnit) is not a group. You do not add users to OU's, you create users in OU's.

  • Images should grow or shrink when the user chooses a larger or smaller font size in ADE.

    Hi All,
    I use percentage values (in "width" attribute within "img" element) for image that should grow or shrink when the user
    chooses a larger or smaller font size. The adjustment affects not only the size of the text but also images but the images
    are getting distorted or blurred when user chooses larger font size in Adobe Digital Editions.
    Can anyone, please guide me; how to get non-distorted and non-blur images in epub package?
    If I directly use images, without svg format i.e. png or jpg files, then images get overlapped on body-text in two column display in ADE.
    OR
    if I directly use jpg or png with width attribute varying in percentage value then image shrinks and grows as user chooses smaller and larger font size but the problem of distorted image remains as it is
    <div class="media-group"><img src="images/pa0000016g26001.png or jpg" alt="Image" width="60 or 70%" /></div>
    Attached is the package (Book.epub) which has test cases.
    ========================================================
    Please find below sample coding used in attached epub package;
    In XHTML:
    <div class="media-group"><img src="images/pa0000016g26001.svg" alt="Image" width="100%" /></div>
    In SVG:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448)  -->
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
    <!ENTITY ns_svg "http://www.w3.org/2000/svg">
    <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
    ]>
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
    width="386px" height="554px" viewBox="0 0 386 554" enable-background="new 0 0 386 554" xml:space="preserve">
    <image overflow="visible" width="772" height="1108" xlink:href="pa0000016g26001.png"  transform="matrix(0.50 0 0 0.50 0 0)">
    </image>
    </svg>
    ========================================================
    Cheers
    Vikas

    Hi DenisonDoc,
    There is no option right now to set properties globally primarily for Text fields. You may make sure fields doesn't contain anything.
    Select all the text filed from the form and right click any of the selected field make sure all of them are selected choose properties --> Appearance there you can choose Font Size and Font type.
    - End users cant change size and type of font. It is up to designer.
    Regards,
    Ajlan Huda.

Maybe you are looking for