jdk/src/windows/native/sun/windows/awt_Choice.h
author ohair
Tue, 28 Dec 2010 15:53:50 -0800
changeset 7668 d4a77089c587
parent 7240 2edee4a70f4f
child 13997 8889b37053e6
permissions -rw-r--r--
6962318: Update copyright year Reviewed-by: xdono
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 7240
diff changeset
     2
 * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2464
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2464
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2464
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2464
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2464
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#ifndef AWT_CHOICE_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#define AWT_CHOICE_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "awt_Component.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#include "java_awt_Choice.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#include "sun_awt_windows_WChoicePeer.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
/************************************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * Component class for system provided buttons
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
class AwtChoice : public AwtComponent {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
public:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    AwtChoice();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    virtual LPCTSTR GetClassName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    static AwtChoice* Create(jobject peer, jobject hParent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    46
    virtual void Dispose();
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    47
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    virtual void Reshape(int x, int y, int w, int h);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    void ResetDropDownHeight();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    int GetDropDownHeight();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
#ifdef DEBUG
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    void VerifyState(); /* verify component and peer are in sync. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    /*for multifont list */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    jobject PreferredItemSize(JNIEnv *env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * Windows message handler functions
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    MsgRouting WmNotify(UINT notifyCode);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    /* for multifont choice */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    MsgRouting OwnerDrawItem(UINT ctrlId, DRAWITEMSTRUCT& drawInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    MsgRouting OwnerMeasureItem(UINT ctrlId, MEASUREITEMSTRUCT& measureInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    /* Workaround for bug #4338368 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    MsgRouting WmKillFocus(HWND hWndGotFocus);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    MsgRouting WmMouseUp(UINT flags, int x, int y, int button);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    MsgRouting HandleEvent(MSG *msg, BOOL synthetic);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    INLINE HWND GetDBCSEditHandle() { return GetHWnd(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    virtual void SetFont(AwtFont *pFont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    virtual BOOL InheritsNativeMouseWheelBehavior();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    virtual void SetDragCapture(UINT flags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    virtual void ReleaseDragCapture(UINT flags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    static BOOL mouseCapture;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    static BOOL skipNextMouseUp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    // called on Toolkit thread from JNI
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    static void _Reshape(void *param);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    static void _Select(void *param);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    static void _AddItems(void *param);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    static void _Remove(void *param);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    static void _RemoveAll(void *param);
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    89
    static void _CloseList(void *param);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
private:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    int GetFieldHeight();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    int GetTotalHeight();
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    94
    static BOOL sm_isMouseMoveInList;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    95
    HWND m_hList;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    96
    WNDPROC m_listDefWindowProc;
7240
2edee4a70f4f 6770017: PIT : java/awt/Choice/BlockedWin32Choice/BlockedWin32Choice.java fails on 6u12 b01 pit build
dcherepanov
parents: 5506
diff changeset
    97
    int m_selectedItem;
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    98
    static LRESULT CALLBACK ListWindowProc(HWND hwnd, UINT message,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2
diff changeset
    99
                                           WPARAM wParam, LPARAM lParam);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
#endif /* AWT_CHOICE_H */